mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-22 11:18:32 +00:00
babel: ensure org-babel-interpreters' is defined before
org-babel-add-interpreter'
* lisp/babel/ob.el: ensure `org-babel-interpreters' is defined before `org-babel-add-interpreter'
This commit is contained in:
parent
6be47552ea
commit
45841a8a9d
|
@ -156,6 +156,16 @@ can not be resolved.")
|
|||
(concat org-babel-source-name-regexp (regexp-quote name) "[ \t\n]*"
|
||||
(substring org-babel-src-block-regexp 1)))
|
||||
|
||||
(defun org-babel-add-interpreter (interpreter)
|
||||
"Add INTERPRETER to `org-babel-interpreters' and update
|
||||
`org-babel-src-block-regexp' appropriately."
|
||||
(unless (member interpreter org-babel-interpreters)
|
||||
(setq org-babel-interpreters
|
||||
(sort (cons interpreter org-babel-interpreters)
|
||||
(lambda (left right)
|
||||
(> (length left) (length right)))))
|
||||
(org-babel-set-interpreters 'org-babel-interpreters org-babel-interpreters)))
|
||||
|
||||
(defun org-babel-set-interpreters (var value)
|
||||
"Update the regular expressions used to match block and inline
|
||||
code."
|
||||
|
@ -177,16 +187,6 @@ code."
|
|||
"{\\([^\f\n\r\v]+?\\)}" ;; (5) body
|
||||
"\\)")))
|
||||
|
||||
(defun org-babel-add-interpreter (interpreter)
|
||||
"Add INTERPRETER to `org-babel-interpreters' and update
|
||||
`org-babel-src-block-regexp' appropriately."
|
||||
(unless (member interpreter org-babel-interpreters)
|
||||
(setq org-babel-interpreters
|
||||
(sort (cons interpreter org-babel-interpreters)
|
||||
(lambda (left right)
|
||||
(> (length left) (length right)))))
|
||||
(org-babel-set-interpreters 'org-babel-interpreters org-babel-interpreters)))
|
||||
|
||||
(defcustom org-babel-interpreters '()
|
||||
"Interpreters allows for evaluation tags.
|
||||
This is a list of program names (as strings) that can evaluate code and
|
||||
|
|
Loading…
Reference in a new issue