summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-08-02 22:56:03 -0400
committerKyle Meyer <kyle@kyleam.com>2020-08-02 22:56:03 -0400
commita103f3f3ee1cc0beb05881cd4e58a38fca1ad30a (patch)
treece5f8589607b47db51d9f63568c6885baafaed92
parentb395f0abf61aadce86a427fb7f86bd6e3628d29a (diff)
parent093b474e6a11d5240f1e88e5ecc7cbbba72ead9d (diff)
downloadorg-mode-a103f3f3ee1cc0beb05881cd4e58a38fca1ad30a.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/ob-core.el5
-rw-r--r--lisp/org-list.el2
-rw-r--r--testing/lisp/test-ob.el19
-rw-r--r--testing/lisp/test-org-list.el7
4 files changed, 31 insertions, 2 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e798595..230706b 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -238,7 +238,10 @@ should be asked whether to allow evaluation."
(if (functionp org-confirm-babel-evaluate)
(funcall org-confirm-babel-evaluate
;; Language, code block body.
- (nth 0 info) (nth 1 info))
+ (nth 0 info)
+ (if (org-babel-noweb-p headers :eval)
+ (org-babel-expand-noweb-references info)
+ (nth 1 info)))
org-confirm-babel-evaluate))))
(cond
(noeval nil)
diff --git a/lisp/org-list.el b/lisp/org-list.el
index fb061b0..c43630d 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -3032,7 +3032,7 @@ With a prefix argument ARG, change the region in a single item."
(if (org-region-active-p)
(setq beg (funcall skip-blanks (region-beginning))
end (copy-marker (region-end)))
- (setq beg (funcall skip-blanks (point-at-bol))
+ (setq beg (point-at-bol)
end (copy-marker (point-at-eol))))
;; Depending on the starting line, choose an action on the text
;; between BEG and END.
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 7c44622..fe59c5e 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -1925,6 +1925,25 @@ default-directory
(message (car pair))
(should (eq (org-test-babel-confirm-evaluate (car pair)) (cdr pair)))))))
+(ert-deftest test-ob/check-eval-noweb-expanded ()
+ "`org-confirm-babel-evaluate' function receives expanded noweb refs."
+ (should
+ (equal t
+ (org-test-with-temp-text "
+#+name: foo
+#+begin_src emacs-lisp
+ :bar
+#+end_src
+
+<point>#+begin_src emacs-lisp :noweb yes
+ <<foo>>
+#+end_src"
+ (let ((org-confirm-babel-evaluate
+ (lambda (_ body)
+ (not (string-match-p ":bar" body)))))
+ (org-babel-check-confirm-evaluate
+ (org-babel-get-src-block-info)))))))
+
(defun org-test-ob/update-block-body ()
"Test `org-babel-update-block-body' specifications."
(should
diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list.el
index abd1a3c..7898f05 100644
--- a/testing/lisp/test-org-list.el
+++ b/testing/lisp/test-org-list.el
@@ -1109,6 +1109,13 @@ b. Item 2<point>"
(org-test-with-temp-text "* H\n:PROPERTIES:\n:A: 1\n:END:\n\n\nText"
(org-toggle-item nil)
(buffer-string))))
+ ;; When no region is marked and point is on a blank line
+ ;; only operate on current line.
+ (should
+ (equal " \n* H :tag:"
+ (org-test-with-temp-text "<point> \n* H :tag:"
+ (org-toggle-item nil)
+ (buffer-string))))
;; When a region is marked and first line is a headline, all
;; headlines are turned into items.
(should