emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: Xebar Saram <zeltakc@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: run a function during capture
Date: Mon, 23 Jan 2017 15:16:51 +0100	[thread overview]
Message-ID: <m2r33tsvxo.fsf@charm-wifi.irisa.fr> (raw)
In-Reply-To: <CAOQHXPpM52sNm8qJk-ofo4E=fDDj76v=YtP6=wmOjW6HVhmTuw@mail.gmail.com> (Xebar Saram's message of "Fri, 20 Jan 2017 15:25:56 +0200")

[-- Attachment #1: Type: text/plain, Size: 1597 bytes --]

On 2017-01-20 15:25, Xebar Saram <zeltakc@gmail.com> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

  reply	other threads:[~2017-01-23 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 16:47 run a function during capture Alan Schmitt
2017-01-19 17:11 ` Nick Dokos
2017-01-23 13:49   ` Alan Schmitt
2017-01-20 13:25 ` Xebar Saram
2017-01-23 14:16   ` Alan Schmitt [this message]
2017-01-23 18:56     ` Nick Dokos
2017-01-24  8:43       ` Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2r33tsvxo.fsf@charm-wifi.irisa.fr \
    --to=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=zeltakc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).