From f54814d108aa2efeaef7e9399e0ff634e0c7a643 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 9 Mar 2011 10:56:47 +0100 Subject: [PATCH] org-macs.el (org-with-wide-buffer): Bugfix. * org-macs.el (org-with-wide-buffer): Bugfix: use `save-excursion' and `save-restriction'. --- lisp/org-macs.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index e67ddb876..5c1c6d281 100644 --- a/lisp/org-macs.el +++ b/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." -- 2.11.4.GIT