I have a function that executes save-excursion
from within an Org Agenda buffer, but it doesn't return the point to the agenda buffer once the body of the excursion finishes executing. Here is the function I call:
(defun link-headline-from-agenda ()
"From an agenda window, link the corresponding headline to the selected file."
(interactive)
(save-excursion
(org-agenda-goto)
(link-headline)))
Is there a way to make save-excursion work as expected or get similar behavior inside an org agenda buffer?
*Org Agenda*
buffer to go to a source buffer and wish to keep the new window configuration, then you may wish to record the initial point/window/buffer in let-bound variables and then return to that point/window/buffer when you are done. If you wish to restore the window layout, then have a look atsave-window-excursion
: gnu.org/software/emacs/manual/html_node/elisp/… The*Org Agenda*
buffer is a summary containing excerpts from one or more source files -- when acting on a source file, a user leaves the agenda buffer.