summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-02-20 02:16:43 -0700
committerEric Schulte <schulte.eric@gmail.com>2011-02-20 02:16:43 -0700
commit39192b78d2b0178a75a5ae1bd5de9f7f15eee5a5 (patch)
treeacaf635c497a04da309b45628c938a4ba0b8f076
parent77c278c93251aa8e2d92af226acb352f53861cb4 (diff)
downloadorg-mode-39192b78d2b0178a75a5ae1bd5de9f7f15eee5a5.tar.gz
ob: allow elisp code in results header arguments
* lisp/ob.el (org-babel-process-params): Allow elisp code in specification of results header arguments.
-rw-r--r--lisp/ob.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index 36e843ff..970ebd9 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -976,8 +976,11 @@ may be specified in the current buffer."
(cdr (assoc :hlines params))
(cdr (assoc :colnames params))
(cdr (assoc :rownames params))))
+ (raw-result (or (cdr (assoc :results params)) ""))
(result-params (append
- (split-string (or (cdr (assoc :results params)) ""))
+ (split-string (if (stringp raw-result)
+ raw-result
+ (eval raw-result)))
(cdr (assoc :result-params params)))))
(append
(mapcar (lambda (var) (cons :var var)) (car vars-and-names))
@@ -1703,7 +1706,10 @@ parameters when merging lists."
vars))))))
(:results
(setq results (e-merge results-exclusive-groups
- results (split-string (cdr pair)))))
+ results
+ (split-string
+ (let ((r (cdr pair)))
+ (if (stringp r) r (eval r)))))))
(:file
(when (cdr pair)
(setq results (e-merge results-exclusive-groups