emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH 2/2] Keep window position in agenda when changing todo states


From: Bernt Hansen
Subject: [O] [PATCH 2/2] Keep window position in agenda when changing todo states
Date: Sat, 14 Jun 2014 10:46:51 -0400

Allow changing task state in agenda without moving point.  I
use this when reviewing projects weekly and I need to change the
state of some of the tasks.  I found jumping to the top of the
agenda after each state change especially annoying when it causes
the agenda to scroll.
---
 lisp/org-agenda.el |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 2d1bafe..d7632b4 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8907,9 +8907,10 @@ If FORCE-TAGS is non nil, the car of it returns the new 
tags."
            (org-agenda-highlight-todo 'line)
            (beginning-of-line 1))
           (t (error "Line update did not work")))
-         (save-restriction
-           (narrow-to-region (point-at-bol) (point-at-eol))
-           (org-agenda-finalize)))
+         (save-window-excursion
+           (save-restriction
+             (narrow-to-region (point-at-bol) (point-at-eol))
+             (org-agenda-finalize))))
        (beginning-of-line 0)))))
 
 (defun org-agenda-align-tags (&optional line)
-- 
1.7.9.48.g85da4d




reply via email to

[Prev in Thread] Current Thread [Next in Thread]