소스 검색

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."