summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <eric.schulte@gmx.com>2011-12-16 17:32:38 -0700
committerEric Schulte <eric.schulte@gmx.com>2011-12-17 09:04:20 -0700
commit34eb48dc3f8b243e2da490592c3302f3af8a4f1f (patch)
treed632a653e2ebd2d84eced207003e09883ed4686d
parentdd98619286f84c4ced735a052ff13e3fe343c980 (diff)
downloadorg-mode-34eb48dc3f8b243e2da490592c3302f3af8a4f1f.tar.gz
move `org-babel-lob-one-liner-regexp' into ob.el to fix autoloading error
* lisp/ob.el (org-babel-map-call-lines): Moved this file from ob-lob.el into ob.el to ease dependency pains.
-rw-r--r--lisp/ob-lob.el23
-rw-r--r--lisp/ob.el25
2 files changed, 24 insertions, 24 deletions
diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el
index d2ebb17..181eee2 100644
--- a/lisp/ob-lob.el
+++ b/lisp/ob-lob.el
@@ -83,29 +83,6 @@ To add files to this list use the `org-babel-lob-ingest' command."
;; functions for executing lob one-liners
;;;###autoload
-(defmacro org-babel-map-call-lines (file &rest body)
- "Evaluate BODY forms on each call line in FILE.
-If FILE is nil evaluate BODY forms on source blocks in current
-buffer."
- (declare (indent 1))
- (let ((tempvar (make-symbol "file")))
- `(let* ((,tempvar ,file)
- (visited-p (or (null ,tempvar)
- (get-file-buffer (expand-file-name ,tempvar))))
- (point (point)) to-be-removed)
- (save-window-excursion
- (when ,tempvar (find-file ,tempvar))
- (setq to-be-removed (current-buffer))
- (goto-char (point-min))
- (while (re-search-forward org-babel-lob-one-liner-regexp nil t)
- (goto-char (match-beginning 1))
- (save-match-data ,@body)
- (goto-char (match-end 0))))
- (unless visited-p (kill-buffer to-be-removed))
- (goto-char point))))
-(def-edebug-spec org-babel-map-call-lines (form body))
-
-;;;###autoload
(defun org-babel-lob-execute-maybe ()
"Execute a Library of Babel source block, if appropriate.
Detect if this is context for a Library Of Babel source block and
diff --git a/lisp/ob.el b/lisp/ob.el
index 1fdda8c..9919416 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -72,7 +72,6 @@
(declare-function org-babel-ref-goto-headline-id "ob-ref" (id))
(declare-function org-babel-ref-headline-body "ob-ref" ())
(declare-function org-babel-lob-execute-maybe "ob-lob" ())
-(declare-function org-babel-map-call-lines "ob-lob" (file &rest body))
(declare-function org-number-sequence "org-compat" (from &optional to inc))
(declare-function org-at-item-p "org-list" ())
(declare-function org-list-parse-list "org-list" (&optional delete))
@@ -861,6 +860,30 @@ buffer."
(goto-char point))))
(def-edebug-spec org-babel-map-inline-src-blocks (form body))
+(defvar org-babel-lob-one-liner-regexp)
+;;;###autoload
+(defmacro org-babel-map-call-lines (file &rest body)
+ "Evaluate BODY forms on each call line in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer."
+ (declare (indent 1))
+ (let ((tempvar (make-symbol "file")))
+ `(let* ((,tempvar ,file)
+ (visited-p (or (null ,tempvar)
+ (get-file-buffer (expand-file-name ,tempvar))))
+ (point (point)) to-be-removed)
+ (save-window-excursion
+ (when ,tempvar (find-file ,tempvar))
+ (setq to-be-removed (current-buffer))
+ (goto-char (point-min))
+ (while (re-search-forward org-babel-lob-one-liner-regexp nil t)
+ (goto-char (match-beginning 1))
+ (save-match-data ,@body)
+ (goto-char (match-end 0))))
+ (unless visited-p (kill-buffer to-be-removed))
+ (goto-char point))))
+(def-edebug-spec org-babel-map-call-lines (form body))
+
;;;###autoload
(defun org-babel-execute-buffer (&optional arg)
"Execute source code blocks in a buffer.