Merge branch 'maint' into master

This commit is contained in:
Kyle Meyer 2020-11-01 18:38:24 -05:00
commit 3b382e9d9e
2 changed files with 29 additions and 2 deletions

View File

@ -405,8 +405,7 @@ inhibit insertion of results into the buffer."
(`lob
(save-excursion
(goto-char (nth 5 info))
(let (org-confirm-babel-evaluate)
(org-babel-execute-src-block nil info)))))))))
(org-babel-execute-src-block nil info))))))))
(provide 'ob-exp)

View File

@ -250,6 +250,34 @@ call_test-newline[:eval yes :results raw]('(1\n2))<point>"
<point>#+call: bar()"
(org-babel-execute-src-block nil (org-babel-lob-get-info))))))
(ert-deftest test-ob-lob/confirm-evaluate ()
"Test confirmation when exporting lob calls."
;; With the default `org-confirm-babel-evaluate' of t, the caller is
;; queried one time.
(should
(= 1
(let ((org-export-use-babel t)
(org-confirm-babel-evaluate t)
(confirm-evaluate-calls 0))
(cl-letf (((symbol-function 'yes-or-no-p)
(lambda (&rest _ignore)
(cl-incf confirm-evaluate-calls)
t)))
(org-test-with-temp-text
"
#+name: foo
#+begin_src emacs-lisp
nil
#+end_src
#+call: foo()"
(let ((string (buffer-string)))
(with-temp-buffer
(org-mode)
(insert string)
(org-babel-exp-process-buffer)
confirm-evaluate-calls))))))))
(provide 'test-ob-lob)
;;; test-ob-lob.el ends here