org-babel: yukni talab qiladigan tillar

Men iloji boricha ko'proq tilni qo'llab-quvvatlovchi katta muxlisman. Xususan, org-babel dan ma'lum bir tilni qo'llab-quvvatlashni istamayman. (Kim biladi, ehtimol Fortranni bir kun yozishim kerak). Biroq men mavjud bo'lgan hamma tillarni birdaniga qo'llab-quvvatlashni yuklash juda achinarli bo'lishi mumkinligini bilaman.

Tilni qo'llab-quvvatlash uchun org-babel uchun biron bir usul mavjudmi?

EDIT: org-babel-execute-src-block - ehtimol taklif qilinishi kerak bo'lgan funksiya.

6

1 javoblar

Bu men uchun shunday ko'rinadi:

#+BEGIN_SRC emacs-lisp
(defadvice org-babel-execute-src-block (around load-language nil activate)
  "Load language if needed"
  (let ((language (org-element-property :language (org-element-at-point))))
    (unless (cdr (assoc (intern language) org-babel-load-languages))
      (add-to-list 'org-babel-load-languages (cons (intern language) t))
      (org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages))
    ad-do-it))
#+END_SRC

Hech bo'lmasa, u gnuplot uchun ishlagan (men gnuplot paketini o'rnatgan va bajariladigan).

4
qo'shib qo'ydi
Bu ajoyib! Rahmat!
qo'shib qo'ydi muallif PythonNut, manba