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

* org-macs.el (org-with-wide-buffer): Bugfix: use
`save-excursion' and `save-restriction'.
This commit is contained in:
Bastien Guerry 2011-03-09 10:56:47 +01:00
parent 4090006ab1
commit f54814d108

View file

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