Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 15b8f60e authored by FELŠÖCI Marek's avatar FELŠÖCI Marek
Browse files

Add handy Babel execution functions

parent bfc7e7c7
No related branches found
No related tags found
1 merge request!2Reinforce the modular of compose-publish, notably including support for styles and themes
...@@ -182,6 +182,26 @@ To solve this problem, when your code only knows the relative path of another fi ...@@ -182,6 +182,26 @@ To solve this problem, when your code only knows the relative path of another fi
(with-current-buffer "*Org PDF LaTeX Output*" (with-current-buffer "*Org PDF LaTeX Output*"
(message (buffer-string)))))) (message (buffer-string))))))
(defun org-babel-execute-file (plist filename pub-dir)
;; A custom publishing function for executing all Babel source code blocks in
;; the Org file `filename'. Note that the function does not actually publish
;; anything to `pub-dir'.
(progn
(find-file filename)
(org-babel-execute-buffer)
(set-buffer-modified-p nil)
(kill-buffer)))
(defun execute-block-in-file (block file)
;; Executes the named source code `block' in `file' without altering the
;; latter.
(progn
(find-file file)
(org-babel-goto-named-src-block block)
(org-babel-execute-src-block)
(set-buffer-modified-p nil)
(kill-buffer)))
;; Use timestamp to avoid publishing ;; Use timestamp to avoid publishing
(setq org-publish-use-timestamps-flag t) (setq org-publish-use-timestamps-flag t)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment