From fe3379bda6ca23474639b114592958bf14431c88 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 6 Nov 2013 16:15:45 +0100 Subject: [PATCH] org.el (org-agenda-prepare-buffers): Restore the point position * org.el (org-agenda-prepare-buffers): Restore the point position. Thanks to Samuel Wales for spotting this. --- lisp/org.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 7b68ba197..2b5e3d056 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18052,10 +18052,10 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (inhibit-read-only t) (org-inhibit-startup org-agenda-inhibit-startup) (rea (concat ":" org-archive-tag ":")) - file re) + file re pos) (setq org-tag-alist-for-agenda nil org-tag-groups-alist-for-agenda nil) - (save-excursion + (save-window-excursion (save-restriction (while (setq file (pop files)) (catch 'nextfile @@ -18065,6 +18065,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (set-buffer (org-get-agenda-file-buffer file))) (widen) (org-set-regexps-and-options-for-tags) + (setq pos (point)) (goto-char (point-min)) (let ((case-fold-search t)) (when (search-forward "#+setupfile" nil t) @@ -18108,7 +18109,8 @@ When a buffer is unmodified, it is just killed. When modified, it is saved org-comment-string)) (while (re-search-forward re nil t) (add-text-properties - (match-beginning 0) (org-end-of-subtree t) pc)))))))) + (match-beginning 0) (org-end-of-subtree t) pc)))) + (goto-char pos))))) (setq org-todo-keywords-for-agenda (org-uniquify org-todo-keywords-for-agenda)) (setq org-todo-keyword-alist-for-agenda -- 2.11.4.GIT