From 6ba3b2d03d277f6e8b67f9ca5ef6de19476bfc09 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 18 Mar 2014 20:54:02 +0100 Subject: [PATCH] org-agenda.el (org-agenda-todo): Restore the window correctly * org-agenda.el (org-agenda-todo): Always restore the window state after `org-agenda-change-all-lines' has been called. `org-agenda-change-all-lines' is narrowing to the line it needs to update. In the narrowed state, `org-agenda-finalize' is called, which may lead to a change in the way the window is displayed. We use `save-window-excursion' to ensure the window state is restored correctly. Thanks to Francesco Pizzolante for reporting this with a detailed recipe. --- lisp/org-agenda.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 54529d47e..e20a55e03 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8792,7 +8792,7 @@ the same tree node, and the headline of the tree node in the Org-mode file." (org-back-to-heading) (move-marker org-last-heading-marker (point)))) (beginning-of-line 1) - (save-excursion + (save-window-excursion (org-agenda-change-all-lines newhead hdmarker 'fixface just-one)) (when (org-bound-and-true-p org-clock-out-when-done) (string-match (concat "^" (regexp-opt org-done-keywords-for-agenda)) -- 2.11.4.GIT