Add helper to evaluate source blocks in subtree without confirmation
This commit is contained in:
parent
2bb88a9634
commit
c91a6d36db
1
init.el
1
init.el
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue