Add helper to evaluate source blocks in subtree without confirmation

This commit is contained in:
Daniel - 2022-07-21 21:54:35 +02:00
parent 2bb88a9634
commit c91a6d36db
Signed by: dbo
GPG Key ID: 784AA8DF0CCDF625
2 changed files with 14 additions and 0 deletions

View File

@ -736,6 +736,7 @@
hydra-org-agenda-view/body
db/org-agenda-insert-efforts
org-babel-execute:hy
db/org-eval-subtree-no-confirm
db/org-timestamp-difference
db/org-capture-code-snippet
hydra-org-clock/body

View File

@ -484,6 +484,19 @@ forces clocking in of the default task."
(format "hy %s" tempfile))
(delete-file tempfile))))
(defun db/org-eval-subtree-no-confirm (&optional arg)
"Evaluate subtree at point without asking for confirmation.
Use with care!
With given ARG, force reevaluation as described for
`org-babel-execute-src-block'."
(interactive)
(unless (derived-mode-p 'org-mode)
(user-error "Not in Org buffer, aborting"))
(let ((org-confirm-babel-evaluate nil))
(org-babel-execute-subtree arg)))
;;; Custom link handlers