[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: |
Mon, 23 Jan 2017 15:16:51 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) |
On 2017-01-20 15:25, Xebar Saram <address@hidden> writes:
> Alan: once you have your org-board and capture setting finalized , i
> would be very interested to get more details on your setup and work
> flow, this looks really interesting!
Here is how I did it:
- on Firefox side, I installed Org-capture for Firefox
http://chadok.info/firefox-org-capture/. Alternatively, you can do it
manually by following http://weblog.zamazal.org/org-mode-firefox/ (in
the “The advanced way” section)
- I "(require 'org-protocol)" and have installed the "org-board"
package.
- I setup a capture template like this:
#+begin_src emacs-lisp
(setq as/org-board-capture-file "my-org-board.org")
(setq org-capture-templates
`(...
("c" "capture through org protocol" entry
(file+headline ,as/org-board-capture-file "Unsorted")
"* %?%:description\n:PROPERTIES:\n:URL: %:link\n:END:\n\n Added %U")
...))
#+end_src
- 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)
I think this is it.
Best,
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-12: 404.48, 2015-12: 401.85
signature.asc
Description: PGP signature