summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-06-16 23:32:58 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-06-16 23:37:40 +0200
commitc3b42e917f5160278000fbcc6f1141e51a57acf8 (patch)
tree5337d5a4692bc8265f3fb98d0d091e1b5bcd7548
parentdbb375fdfcf27ea447f0da004949200824c29e64 (diff)
downloadorg-mode-c3b42e917f5160278000fbcc6f1141e51a57acf8.tar.gz
ob: Remove `org-babel-lob-execute'
* lisp/ob-lob.el (org-babel-lob-execute): Remove function (org-babel-lob-execute-maybe): * lisp/ob-ref.el (org-babel-ref-resolve): * testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/global/call): (test-ob-header-arg-defaults/tree/overwrite/call): (test-ob-header-arg-defaults/tree/accumulate/call): (test-ob-header-arg-defaults/tree/complex/call): * testing/lisp/test-ob-lob.el (test-ob-lob/named-caching-call-line): (test-ob-lob/caching-call-line): (test-ob-lob/call-with-header-arguments): Apply removal.
-rw-r--r--lisp/ob-core.el1
-rw-r--r--lisp/ob-lob.el6
-rw-r--r--lisp/ob-ref.el5
-rw-r--r--testing/lisp/test-ob-header-arg-defaults.el8
-rw-r--r--testing/lisp/test-ob-lob.el55
5 files changed, 37 insertions, 38 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 7221eb4..532b06d 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -81,7 +81,6 @@
(declare-function org-babel-ref-resolve "ob-ref" (ref))
(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-number-sequence "org-compat" (from &optional to inc))
(declare-function org-at-item-p "org-list" ())
(declare-function org-list-to-generic "org-list" (LIST PARAMS))
diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el
index 7d68092..5340002 100644
--- a/lisp/ob-lob.el
+++ b/lisp/ob-lob.el
@@ -83,7 +83,7 @@ if so then run the appropriate source block from the Library."
(interactive)
(let ((info (org-babel-lob-get-info)))
(when info
- (org-babel-lob-execute info)
+ (org-babel-execute-src-block nil info)
t)))
(defun org-babel-lob--src-info (name)
@@ -153,10 +153,6 @@ compatible with `org-babel-get-src-block-info', which see."
begin)))
(_ nil)))))
-(defun org-babel-lob-execute (info)
- "Execute the lob call specified by INFO."
- (org-babel-execute-src-block nil info))
-
(provide 'ob-lob)
;; Local variables:
diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el
index df5488b..392abbb 100644
--- a/lisp/ob-ref.el
+++ b/lisp/ob-ref.el
@@ -52,7 +52,6 @@
(require 'ob-core)
(require 'cl-lib)
-(declare-function org-babel-lob-execute "ob-lob" (info))
(declare-function org-babel-lob-get-info "ob-lob" (&optional datum))
(declare-function org-element-at-point "org-element" ())
(declare-function org-element-property "org-element" (property element))
@@ -173,8 +172,8 @@ the variable."
(pcase (org-element-type e)
(`babel-call
(throw :found
- (org-babel-lob-execute
- (org-babel-lob-get-info e))))
+ (org-babel-execute-src-block
+ nil (org-babel-lob-get-info e))))
(`src-block
(throw :found
(org-babel-execute-src-block
diff --git a/testing/lisp/test-ob-header-arg-defaults.el b/testing/lisp/test-ob-header-arg-defaults.el
index 604738f..d00c316 100644
--- a/testing/lisp/test-ob-header-arg-defaults.el
+++ b/testing/lisp/test-ob-header-arg-defaults.el
@@ -25,7 +25,7 @@
(org-babel-next-src-block 1)
(forward-line -1)
(should (equal "ge1/gh2/go3/ge4/ge5/--6/--7/--8/--9"
- (org-babel-lob-execute (org-babel-lob-get-info))))))
+ (org-babel-execute-src-block nil (org-babel-lob-get-info))))))
(ert-deftest test-ob-header-arg-defaults/global/noweb ()
(org-test-at-id "3fdadb69-5d15-411e-aad0-f7860cdd7816"
@@ -38,7 +38,7 @@
(org-babel-next-src-block 1)
(forward-line -1)
(should (equal "ge1/gh2/go3/ge4/ge5/to6/th7/te8/--9"
- (org-babel-lob-execute (org-babel-lob-get-info))))))
+ (org-babel-execute-src-block nil (org-babel-lob-get-info))))))
(ert-deftest test-ob-header-arg-defaults/tree/overwrite/noweb ()
(org-test-at-id "a9cdfeda-9f31-4bb5-b694-2cf452f07dfd"
@@ -51,7 +51,7 @@
(org-babel-next-src-block 1)
(forward-line -1)
(should (equal "ge1/th2/th3/ge4/te5/to6"
- (org-babel-lob-execute (org-babel-lob-get-info))))))
+ (org-babel-execute-src-block nil (org-babel-lob-get-info))))))
(ert-deftest test-ob-header-arg-defaults/tree/accumulate/noweb ()
(org-test-at-id "1d97d258-fd50-4107-a095-e4625bffc57b"
@@ -64,7 +64,7 @@
(org-babel-next-src-block 1)
(forward-line -1)
(should (equal "gh1/th2/go3/gh4/te5/to6"
- (org-babel-lob-execute (org-babel-lob-get-info))))))
+ (org-babel-execute-src-block nil (org-babel-lob-get-info))))))
(ert-deftest test-ob-header-arg-defaults/tree/complex/noweb ()
(org-test-at-id "fa0e912d-d9b4-47b0-9f9e-1cbb39f7cbc2"
diff --git a/testing/lisp/test-ob-lob.el b/testing/lisp/test-ob-lob.el
index cf7cde2..7f769c9 100644
--- a/testing/lisp/test-ob-lob.el
+++ b/testing/lisp/test-ob-lob.el
@@ -40,41 +40,42 @@
(ert-deftest test-ob-lob/call-with-header-arguments ()
"Test the evaluation of a library of babel #+call: line."
(letf (((symbol-function 'org-babel-insert-result)
- (symbol-function 'ignore)))
+ (symbol-function 'ignore)))
(org-test-at-id "fab7e291-fde6-45fc-bf6e-a485b8bca2f0"
(move-beginning-of-line 1)
(forward-line 6)
(message (buffer-substring (point-at-bol) (point-at-eol)))
- (should (string= "testing" (org-babel-lob-execute
- (org-babel-lob-get-info))))
+ (should (string= "testing" (org-babel-execute-src-block
+ nil (org-babel-lob-get-info))))
(forward-line 1)
- (should (string= "testing" (caar (org-babel-lob-execute
- (org-babel-lob-get-info)))))
+ (should (string= "testing" (caar (org-babel-execute-src-block
+ nil (org-babel-lob-get-info)))))
(forward-line 1)
- (should (string= "testing" (org-babel-lob-execute
- (org-babel-lob-get-info))))
+ (should (string= "testing" (org-babel-execute-src-block
+ nil (org-babel-lob-get-info))))
(forward-line 1)
- (should (string= "testing" (caar (org-babel-lob-execute
- (org-babel-lob-get-info)))))
+ (should (string= "testing" (caar (org-babel-execute-src-block
+ nil (org-babel-lob-get-info)))))
(forward-line 1)
- (should (string= "testing" (org-babel-lob-execute
- (org-babel-lob-get-info))))
+ (should (string= "testing" (org-babel-execute-src-block
+ nil (org-babel-lob-get-info))))
(forward-line 1)
- (should (string= "testing" (caar (org-babel-lob-execute
- (org-babel-lob-get-info)))))
+ (should (string= "testing" (caar (org-babel-execute-src-block
+ nil (org-babel-lob-get-info)))))
(forward-line 1) (beginning-of-line) (forward-char 27)
- (should (string= "testing" (org-babel-lob-execute
- (org-babel-lob-get-info))))
+ (should (string= "testing" (org-babel-execute-src-block
+ nil (org-babel-lob-get-info))))
(forward-line 1) (beginning-of-line) (forward-char 27)
- (should (string= "testing" (caar (org-babel-lob-execute
- (org-babel-lob-get-info)))))
+ (should (string= "testing" (caar (org-babel-execute-src-block
+ nil (org-babel-lob-get-info)))))
(forward-line 1) (beginning-of-line)
- (should (= 4 (org-babel-lob-execute (org-babel-lob-get-info))))
+ (should (= 4 (org-babel-execute-src-block nil (org-babel-lob-get-info))))
(forward-line 1)
- (should (string= "testing" (org-babel-lob-execute
- (org-babel-lob-get-info))))
+ (should (string= "testing" (org-babel-execute-src-block
+ nil (org-babel-lob-get-info))))
(forward-line 1)
- (should (string= "123" (org-babel-lob-execute (org-babel-lob-get-info)))))))
+ (should (string= "123" (org-babel-execute-src-block
+ nil (org-babel-lob-get-info)))))))
(ert-deftest test-ob-lob/export-lob-lines ()
"Test the export of a variety of library babel call lines."
@@ -118,9 +119,11 @@ for export
<point>#+call: call-line-caching-example(\"qux\") :cache yes
"
;; first execution should flip value to t
- (should (equal (org-babel-lob-execute (org-babel-lob-get-info)) 1))
+ (should
+ (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1))
;; if cached, second evaluation will retain the t value
- (should (equal (org-babel-lob-execute (org-babel-lob-get-info)) 1)))))
+ (should
+ (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1)))))
(ert-deftest test-ob-lob/named-caching-call-line ()
(let ((temporary-value-for-test 0))
@@ -134,9 +137,11 @@ for export
<point>#+call: call-line-caching-example(\"qux\") :cache yes
"
;; first execution should flip value to t
- (should (equal (org-babel-lob-execute (org-babel-lob-get-info)) 1))
+ (should
+ (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1))
;; if cached, second evaluation will retain the t value
- (should (equal (org-babel-lob-execute (org-babel-lob-get-info)) 1)))))
+ (should
+ (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1)))))
(provide 'test-ob-lob)