Browse Source

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

Eric Schulte 10 years ago
parent
commit
dc2baab09c
1 changed files with 5 additions and 4 deletions
  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.