[Top][All Lists]

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

Re: [O] run a function during capture

From: Alan Schmitt
Subject: Re: [O] run a function during capture
Date: Tue, 24 Jan 2017 09:43:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin)

On 2017-01-23 13:56, Nick Dokos <address@hidden> writes:

> Alan Schmitt <address@hidden> writes:
>> ...
>> - I added a hook to org-capture-after-finalize-hook
>                                   ^^^^^
>>   #+begin_src emacs-lisp
>>   (defun as/do-org-board-dl-hook ()
>>     (when (equal (buffer-name) (concat "CAPTURE-" as/org-board-capture-file))
>>       (org-board-archive)))
>>   (add-hook 'org-capture-before-finalize-hook 'as/do-org-board-dl-hook)
>                            ^^^^^^
>>   #+end_src
>> (Note: I mistakenly said that the "prepare" hook worked, but that would
>                                      ^^^^^^^
>> download the file even when cancelling, which was wrong)
> Make up your mind, will you? :-)

As you can guess, I was testing as I was editing the message. As always,
the code is the truth™.

For the record, here is what I discovered:
- the prepare hook is run even when cancelling
- the before hook is run with the buffer widened, but the point is still
in the same position as when confirming pointer
- when the after hook is run, I did not get access to the captured data
(I may have done it wrong, but since the before hook worked, I did not
look further)



OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-12: 404.48, 2015-12: 401.85

Attachment: signature.asc
Description: PGP signature

reply via email to

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