From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: question about agendas Date: Thu, 31 Mar 2011 14:51:11 -0400 Message-ID: <4239.1301597471@alphaville.usa.hp.com> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=39769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5Mxf-0001mh-2Q for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 14:51:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5Mxd-00088R-NG for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 14:51:14 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:1441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5Mxd-00088A-Jn for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 14:51:13 -0400 In-Reply-To: Message from "Filippo A. Salustri" of "Thu, 31 Mar 2011 14:39:50 EDT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Filippo A. Salustri" Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Filippo A. Salustri wrote: > Hi all, > I'm looking to customize how some agenda commands work. > The simple example I'm working on is combining changing a task's > priority AND refreshing the agenda. > > What I'd normally do is: > 1. cursor to the task of interest, > 2. change its priority, > 3. refresh the agenda. > > After step 3, the cursor remains where it was in step 2. That's fine. > > Then I rebind , in org-agenda-mode-map to this: > (defun org-fas-agenda-priority (&optional p) > "Change the priority of the current item, then refresh agenda." > (interactive) > (save-excursion > (if (org-agenda-priority p) > (org-agenda-redo)))) > > When this function runs, it does exactly what I want it to do. > > BUT the cursor jumps to row one of the agenda buffer. > > Can anyone suggest a cause and a fix? > I don't understand it yet, but can you try without the save-excursion and see if it does what you want? Nick