"Filippo A. Salustri" <salus...@ryerson.ca> 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

-- 

Reply via email to