浏览代码

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.
Eric Schulte 12 年之前
父节点
当前提交
f51fd88554
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      lisp/ob-core.el

+ 5 - 2
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."