From f83f31d82c0c660c74a2af7114d4e23c9b37c095 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sun, 31 Mar 2013 19:02:11 -0600 Subject: [PATCH] :post header arg post-processes code block results * lisp/ob-core.el (org-babel-common-header-args-w-values): Add :post to the list of header arguments. (org-babel-execute-src-block): Post process results when the :post header argument has been supplied. --- lisp/ob-core.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 723aa9d..e1321eb 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -456,6 +456,7 @@ then run `org-babel-pop-to-session'." (noweb-ref . :any) (noweb-sep . :any) (padline . ((yes no))) + (post . :any) (results . ((file list vector table scalar verbatim) (raw html latex org code pp drawer) (replace silent none append prepend) @@ -625,6 +626,11 @@ block." (not (listp result))) (list (list result)) result)) (funcall cmd body params))) + ;; possibly perform post process provided its appropriate + (when (cdr (assoc :post params)) + (let ((*this* result)) + (setq result (org-babel-ref-resolve + (cdr (assoc :post params)))))) ;; if non-empty result and :file then write to :file (when (cdr (assoc :file params)) (when result -- 1.8.2