emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Jambunathan K
Subject: Re: [O] odd behaviour in a function - looking for advice
Date: Fri, 17 Jun 2011 07:26:56 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt)

Jambunathan K <address@hidden> writes:

> "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.

Also look at window-buffer or functions that start with
window-configuration-*.

Disclaimer: I cannot assure that the solution I suggest would work or is
correct but they sound like good starting points.

>
>> Anyone got any idea what I'm doing wrong?
>> Cheers.
>> Fil



reply via email to

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