浏览代码

babel: protecting restrictions on `org-babel-execute-subtree'

Eric Schulte 15 年之前
父节点
当前提交
dc2baab09c
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      contrib/babel/lisp/org-babel.el

+ 5 - 4
contrib/babel/lisp/org-babel.el

@@ -384,10 +384,11 @@ the current buffer."
   "Call `org-babel-execute-src-block' on every source block in
 the current subtree."
   (interactive "P")
-  (save-excursion
-    (org-narrow-to-subtree)
-    (org-babel-execute-buffer)
-    (widen)))
+  (save-restriction
+    (save-excursion
+      (org-narrow-to-subtree)
+      (org-babel-execute-buffer)
+      (widen))))
 
 (defun org-babel-get-src-block-info (&optional header-vars-only)
   "Get information of the current source block.