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:
Eric Schulte 2010-06-12 16:02:50 -07:00
parent 6be47552ea
commit 45841a8a9d
1 changed files with 10 additions and 10 deletions

View File

@ -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