summaryrefslogtreecommitdiff
path: root/lisp/org/ob-lob.el
diff options
context:
space:
mode:
authorBastien Guerry <bastien1@free.fr>2012-01-03 18:27:21 +0100
committerBastien Guerry <bastien1@free.fr>2012-01-03 18:27:21 +0100
commite66ba1dfc4cf2e12100191d2c24436c42d097268 (patch)
treeb50b009e703fe1a9e8cb13cddf7928a97ad6210c /lisp/org/ob-lob.el
parent88c5c7c8313162b94173fd4333e6062aa07c4d2e (diff)
downloademacs-e66ba1dfc4cf2e12100191d2c24436c42d097268.tar.gz
Merge Org 7.8.03
Diffstat (limited to 'lisp/org/ob-lob.el')
-rw-r--r--lisp/org/ob-lob.el22
1 files changed, 8 insertions, 14 deletions
diff --git a/lisp/org/ob-lob.el b/lisp/org/ob-lob.el
index 5cb40a057f3..181eee22b31 100644
--- a/lisp/org/ob-lob.el
+++ b/lisp/org/ob-lob.el
@@ -6,7 +6,6 @@
;; Dan Davison
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
-;; Version: 7.7
;; This file is part of GNU Emacs.
@@ -29,6 +28,8 @@
(require 'ob)
(require 'ob-table)
+(declare-function org-babel-in-example-or-verbatim "ob-exp" nil)
+
(defvar org-babel-library-of-babel nil
"Library of source-code blocks.
This is an association list. Populate the library by adding
@@ -62,24 +63,15 @@ To add files to this list use the `org-babel-lob-ingest' command."
lob-ingest-count (if (> lob-ingest-count 1) "s" ""))
lob-ingest-count))
-(defconst org-babel-lob-call-aliases '("lob" "call")
- "Aliases 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-block-lob-one-liner-regexp
(concat
- "^\\([ \t]*\\)#\\+\\(?:"
- (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
- "\\):[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
+ "^\\([ \t]*\\)#\\+call:[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
"\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
"Regexp to match non-inline calls to predefined source block functions.")
(defconst org-babel-inline-lob-one-liner-regexp
(concat
- "\\([^\n]*\\)\\(?:"
- (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
- "\\)_\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
+ "\\([^\n]*\\)call_\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
"\(\\([^\n]*\\)\)\\(\\[\\(.*?\\)\\]\\)?")
"Regexp to match inline calls to predefined source block functions.")
@@ -89,6 +81,7 @@ If you change the value of this variable then your files may
"Regexp to match calls to predefined source block functions.")
;; functions for executing lob one-liners
+
;;;###autoload
(defun org-babel-lob-execute-maybe ()
"Execute a Library of Babel source block, if appropriate.
@@ -96,7 +89,9 @@ Detect if this is context for a Library Of Babel source block and
if so then run the appropriate source block from the Library."
(interactive)
(let ((info (org-babel-lob-get-info)))
- (if (nth 0 info) (progn (org-babel-lob-execute info) t) nil)))
+ (if (and (nth 0 info) (not (org-babel-in-example-or-verbatim)))
+ (progn (org-babel-lob-execute info) t)
+ nil)))
;;;###autoload
(defun org-babel-lob-get-info ()
@@ -126,7 +121,6 @@ if so then run the appropriate source block from the Library."
(let ((params (org-babel-process-params
(org-babel-merge-params
org-babel-default-header-args
- (org-babel-params-from-buffer)
(org-babel-params-from-properties)
(org-babel-parse-header-arguments
(org-babel-clean-text-properties