From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Filippo A. Salustri" Subject: question about agendas Date: Thu, 31 Mar 2011 14:39:50 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from [140.186.70.92] (port=45963 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5Mmf-0003Uz-Ci for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 14:39:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5Mme-0005SK-0n for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 14:39:53 -0400 Received: from mail-ww0-f41.google.com ([74.125.82.41]:51855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5Mmd-0005S7-PU for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 14:39:51 -0400 Received: by wwi18 with SMTP id 18so5403316wwi.0 for ; Thu, 31 Mar 2011 11:39:51 -0700 (PDT) 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: emacs-orgmode@gnu.org 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? Cheers. Fil -- Filippo A. Salustri, Ph.D., P.Eng. Mechanical and Industrial Engineering Ryerson University 350 Victoria St, Toronto, ON M5B 2K3, Canada Tel: 416/979-5000 ext 7749 Fax: 416/979-5265 Email: salustri@ryerson.ca http://deseng.ryerson.ca/~fil/