Преглед изворни кода

org-macs.el (org-with-wide-buffer): Bugfix.

* org-macs.el (org-with-wide-buffer): Bugfix: use
`save-excursion' and `save-restriction'.
Bastien Guerry пре 14 година
родитељ
комит
f54814d108
1 измењених фајлова са 5 додато и 7 уклоњено
  1. 5 7
      lisp/org-macs.el

+ 5 - 7
lisp/org-macs.el

@@ -334,13 +334,11 @@ point nowhere."
 	       data)))))
 
 (defmacro org-with-wide-buffer (&rest body)
-  "Execute body while temporarily widening the buffer."
-  `(let ((beg (point-min)) (end (point-max)) (pos (point)))
-     (prog2
-	 (widen)
-	 ,@body
-       (narrow-to-region beg end)
-       (goto-char pos))))
+ "Execute body while temporarily widening the buffer."
+ `(save-excursion
+    (save-restriction
+       (widen)
+       ,@body)))
 
 (defmacro org-with-limited-levels (&rest body)
   "Execute BODY with limited number of outline levels."