diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2013-03-31 19:02:11 -0600 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2013-04-04 06:41:55 -0600 |
commit | d35ec18ab556824c3e66a0c13c0e87d780ee68c7 (patch) | |
tree | 2e8371d3958e2d7c9e52211b9ba5dd21c132cac9 | |
parent | bc3ccdfba25c666c306a6a4135bf0dbb19577328 (diff) | |
download | org-mode-d35ec18ab556824c3e66a0c13c0e87d780ee68c7.tar.gz |
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.
-rw-r--r-- | lisp/ob-core.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 433ce9b..fea91d8 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -442,6 +442,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) @@ -611,6 +612,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 |