[Top][All Lists]

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

Re: [O] odd behaviour in a function - looking for advice

From: Filippo A. Salustri
Subject: Re: [O] odd behaviour in a function - looking for advice
Date: Thu, 16 Jun 2011 22:01:26 -0400

save-window-excursion did the trick.  Never heard of that one.

On 16 June 2011 21:46, Jambunathan K <address@hidden> wrote:
> "Filippo A. Salustri" <address@hidden> writes:
>> 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.
> save-window-excursion maybe?
> Or you could solve the problem by one switch-to-buffer-other-window.
> Just a quick hint.
>> Anyone got any idea what I'm doing wrong?
>> 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: address@hidden

reply via email to

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