[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Capture templates with "function" type
From: |
Brett Viren |
Subject: |
Re: [O] Capture templates with "function" type |
Date: |
Tue, 05 Nov 2013 13:00:56 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Hi Bastien,
Bastien <address@hidden> 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.
pgpf9hkW9IRoU.pgp
Description: PGP signature