Hi Bastien,

Bastien <b...@gnu.org> writes:

> You may try this (not tested myself):
>
> (defun bv-daily-log-file ()
>   (save-window-excursion
>     (find-file (concat "~/org/web/notes/" 
>                      (format-time-string "%Y-%m-%d") ".org"))
>     (goto-char (point-max))
>     (newline 2)))
>
> The trick is to use `save-window-excursion'.

Thanks for the pointer but it looks like this macro runs afoul of the
capture process somehow.  I redefined my function as you have above and
did C-xC-e to reload it and then initiated a capture from a window
showing my GNUS summary.  It fails with:

byte-code: Capture abort: (buffer-read-only #<killed buffer>)

I then tried another capture staring from a read-write buffer.  The
capture succeeds but the captured text is inserted into this starting
buffer instead of the one found by the bv-daily-log-file function.

The Elisp manual mentions that save-selected-window is sometimes a
better alternative but that gives the same behavior.  

Do you maybe have further ideas I could try?  

Thanks,
-Brett.

Attachment: pgpmfnukccpMQ.pgp
Description: PGP signature

Reply via email to