浏览代码

`org-babel-do-in-edit-buffer': more lightweight test of context

	* ob.el (org-babel-do-in-edit-buffer): Use
	`org-babel-where-is-src-block-head' to test for source block
	at point.
Dan Davison 14 年之前
父节点
当前提交
0e1ff9ddbc
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lisp/ob.el

+ 2 - 1
lisp/ob.el

@@ -510,7 +510,8 @@ with a prefix argument then this is passed on to
   "Evaluate BODY in edit buffer if there is a code block at point.
 Return t if a code block was found at point, nil otherwise."
   `(let ((org-src-window-setup 'switch-invisibly))
-     (when (org-edit-src-code nil nil nil 'quietly)
+     (when (and (org-babel-where-is-src-block-head)
+		(org-edit-src-code nil nil nil 'quietly))
        (unwind-protect (progn ,@body)
 	 (if (org-bound-and-true-p org-edit-src-from-org-mode)
 	     (org-edit-src-exit)))