From bf6089d8def7b1c58c9384a609c285bf552a1aea Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sun, 1 Nov 2009 10:29:50 -0500 Subject: [PATCH] org-babel: allow aliases for #+lob This introduces #+call as an alias for #+lob. --- contrib/babel/lisp/org-babel-lob.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/contrib/babel/lisp/org-babel-lob.el b/contrib/babel/lisp/org-babel-lob.el index 02bd1101a..d1a1b17d3 100644 --- a/contrib/babel/lisp/org-babel-lob.el +++ b/contrib/babel/lisp/org-babel-lob.el @@ -54,9 +54,19 @@ add files to this list use the `org-babel-lob-ingest' command." (cons (cons source-name info) (assq-delete-all source-name org-babel-library-of-babel))))))) -;; functions for executing lob one-liners +(defconst org-babel-lob-call-aliases '("lob" "call") + "These can be used interchangeably to call a source block + function. If you change the value of this variable then your + files may become unusable by other org-babel users, and vice + versa.") + +(defconst org-babel-lob-one-liner-regexp + (concat "^[ \t]*#\\+\\(?:" + (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|") + "\\):[ \t]+\\([^\(\)\n]+\\)\(\\([^\n]*\\)\)[ \t]*\\([^\n]*\\)") + "Regexp to match calls to predefined source block functions") -(defvar org-babel-lob-one-liner-regexp "^[ \t]*#\\+lob:[ \t]+\\([^\(\)\n]+\\)\(\\([^\n]*\\)\)[ \t]*\\([^\n]*\\)") +;; functions for executing lob one-liners (defun org-babel-lob-execute-maybe () "Detect if this is context for a org-babel Library Of Babel