summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gillespie <tgbugs@gmail.com>2020-09-04 20:35:03 -0700
committerKyle Meyer <kyle@kyleam.com>2020-09-05 23:38:35 -0400
commit3e1c0b0f44b977510a6171a74f5f845abfc4e431 (patch)
tree16c15a0720cde1c4ae9a279a45f550e85a3b37b0
parentc7abcd514a755a0bd8c4121d9f048996528b9df6 (diff)
downloadorg-mode-3e1c0b0f44b977510a6171a74f5f845abfc4e431.tar.gz
lisp/ob-core.el: org-babel-check-confirm-evaluate strip coderefs
* lisp/ob-core.el (org-babel-check-confirm-evaluate): strip coderefs before passing the body of the block to org-confirm-babel-evaluate using the same let block as is used in org-babel-execute-src-block.
-rw-r--r--lisp/ob-core.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index eb61763..b13d061 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -240,9 +240,14 @@ should be asked whether to allow evaluation."
(funcall org-confirm-babel-evaluate
;; Language, code block body.
(nth 0 info)
- (if (org-babel-noweb-p headers :eval)
- (org-babel-expand-noweb-references info)
- (nth 1 info)))
+ (let ((coderef (nth 6 info))
+ (expand
+ (if (org-babel-noweb-p headers :eval)
+ (org-babel-expand-noweb-references info)
+ (nth 1 info))))
+ (if (not coderef) expand
+ (replace-regexp-in-string
+ (org-src-coderef-regexp coderef) "" expand nil nil 1))))
org-confirm-babel-evaluate))))
(cond
(noeval nil)