From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH 2/2] Keep window position in agenda when changing todo states Date: Sat, 14 Jun 2014 10:46:51 -0400 Message-ID: <1402757211-30510-3-git-send-email-bernt@norang.ca> References: <1402757211-30510-1-git-send-email-bernt@norang.ca> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvpEm-0007hT-HB for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 10:47:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvpEe-00048n-9a for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 10:47:20 -0400 Received: from mho-03-ewr.mailhop.org ([204.13.248.66]:47944 helo=mho-01-ewr.mailhop.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvpEe-00046W-6U for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 10:47:12 -0400 Received: from cpe000102d0fe75-cm68b6fcf41760.cpe.net.cable.rogers.com ([99.239.136.54] helo=mail.norang.ca) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WvpEX-000CN9-M9 for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 14:47:05 +0000 In-Reply-To: <1402757211-30510-1-git-send-email-bernt@norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Bernt Hansen 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