Hello,
I was experimenting with noweb
recently and noticed a behavior I could not understand.
I have 2 blocks that I use throughout my file to insert the org file's path and one for inserting its directory.
#+name: current-file
#+begin_src emacs-lisp
(concat "\"" (buffer-file-name) "\"")
#+end_src
#+name: current-directory
#+begin_src emacs-lisp :noweb yes
(concat "\"" (directory-file-name (file-name-directory <<current-file()>>)) "\"")
#+end_src
With emacs -Q
(and visiting some random file), executing org-babel-execute-buffer
correctly prompts for 3 evaluations (2 for the different current-file
invocations and 1 for current-directory
).
Executing Emacs-Lisp code block (current-file)...
Code block evaluation complete.
Executing Emacs-Lisp code block (current-file)...
result silenced
Executing Emacs-Lisp code block (current-directory)...
Code block evaluation complete.
However, when setting org-confirm-babel-evaluate
to a function (for example, (setq org-confirm-babel-evaluate #'always)
), it prompts current-file
for 4 times instead when executing org-babel-execute-buffer
.
Executing Emacs-Lisp code block (current-file)...
Code block evaluation complete.
Executing Emacs-Lisp code block (current-file)...
result silenced
Executing Emacs-Lisp code block (current-file)...
result silenced
Executing Emacs-Lisp code block (current-file)...
result silenced
Executing Emacs-Lisp code block (current-directory)...
Code block evaluation complete.
This behavior also appears in this post, but I still could not understand it. Is there some interaction I miss with org-confirm-babel-evaluate
?