From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Filippo A. Salustri" Subject: odd behaviour in a function - looking for advice Date: Thu, 16 Jun 2011 21:34:39 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXNxM-0005Vh-9v for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 21:34:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXNxL-0002iT-0T for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 21:34:44 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:59689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXNxK-0002hx-9X for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 21:34:42 -0400 Received: by wwb39 with SMTP id 39so1785630wwb.30 for ; Thu, 16 Jun 2011 18:34:41 -0700 (PDT) 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 mailing list Hi all, I've got this function: (defun fas/org-priority (&optional p) "Change the priority of the current item, then refresh agenda." (interactive) (save-excursion (if (org-priority p) (org-agenda-redo)))) I set up my window to have 2 frames side by side. The org agenda is in the left frame. In the right frame is whatever org file I'm working on. In the org file (right frame), I call the above function, having bound it to \C-, It does what it's supposed to to the priority, but then the point moves to the agenda frame and goes to the end of the agenda buffer. I would have thought 'save-excursion' would have returned the point to wherever I was when I called the function. Anyone got any idea what I'm doing wrong? Cheers. Fil -- \V/_ 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/