Evaluate specific Python source blocks only interactively

This commit is contained in:
Gerard Vermeulen 2022-05-09 06:30:13 +02:00
parent 91686ac761
commit 1ed603ba5d

View File

@ -2025,15 +2025,16 @@ variables in order to export the =info-org-link= types in this document to
(defun org-eval-emacs-lisp-setup-blocks ()
"Evaluate all source blocks having \"emacs-lisp-setup\" in their name."
(interactive)
(org-eval-infixed-blocks "emacs-lisp-setup"))
(defun org-eval-python-setup-blocks ()
"Evaluate all source blocks having \"python-setup\" in their name."
(interactive)
(org-eval-infixed-blocks "python-setup"))
;; Emacs looks for "Local variables:" after the last "?\n?\f".
(add-to-list 'safe-local-eval-forms '(org-eval-emacs-lisp-setup-blocks))
(add-to-list 'safe-local-eval-forms '(org-eval-python-setup-blocks)))
(add-to-list 'safe-local-eval-forms '(org-eval-emacs-lisp-setup-blocks)))
(with-eval-after-load 'emacs
(defun my-org-eval-blocks-named (infix)
@ -2051,9 +2052,7 @@ variables in order to export the =info-org-link= types in this document to
;; Emacs looks for "Local variables:" after the last "?\n?\f".
(add-to-list 'safe-local-eval-forms
'(apply 'my-org-eval-blocks-named '("emacs-lisp-setup")))
(add-to-list 'safe-local-eval-forms
'(apply 'my-org-eval-blocks-named '("python-setup"))))
'(apply 'my-org-eval-blocks-named '("emacs-lisp-setup"))))
#+end_src
*** [[info:org#LaTeX header and sectioning][Easy LaTeX preamble editing]]