diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2013-02-24 09:49:12 -0700 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2013-02-24 09:50:46 -0700 |
commit | f51fd88554c64a3b0e9be23a5a134c557406d3fb (patch) | |
tree | 7f79a74e71801ac41de1d64bdc2d378adc005f90 | |
parent | f30866b03bbf9a74247c225da922a3403fa77858 (diff) | |
download | org-mode-f51fd88554c64a3b0e9be23a5a134c557406d3fb.tar.gz |
Return expanded code on programmatic calls
* lisp/ob-core.el (org-babel-expand-src-block): Return value of expanded
code block on non-interactive calls.
-rw-r--r-- | lisp/ob-core.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 717746e..3278bf9 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -630,8 +630,11 @@ arguments and pop open the results in a preview buffer." (org-babel-expand-body:generic body params (and (fboundp assignments-cmd) (funcall assignments-cmd params)))))) - (org-edit-src-code - nil expanded (concat "*Org-Babel Preview " (buffer-name) "[ " lang " ]*")))) + (if (called-interactively-p 'any) + (org-edit-src-code + nil expanded + (concat "*Org-Babel Preview " (buffer-name) "[ " lang " ]*")) + expanded))) (defun org-babel-edit-distance (s1 s2) "Return the edit (levenshtein) distance between strings S1 S2." |