org-capture-vars.el

User-defined capture variables and prompts for Org-mode

  • org-capture-vars.el ** User-defined capture variables and prompts for Org-mode

For use with Org capture mode’s ~%(…)~ Lisp escape syntax.

~%(ocv/prmt PROMPT VARIABLE &optional DEFAULT COMPLETIONS)~

*** Example You might define an Org capture template for capturing JIRA tickets like this:

#+BEGIN_SRC org * JIRA Ticket %(ocv/prmt “JIRA Ticket No.” ‘jr-no) I have to do the following stuff: ** Triage %(progn jr-no) #+END_SRC

to be prompted for the JIRA ticket number to enter. Your entered text will be stored in buffer-local variable ~jr-no~. If you enter, say, “4321” at the prompt, your capture output will look like:

#+BEGIN_SRC org * JIRA Ticket 4321 I have to do the following stuff: ** Triage 4321 #+END_SRC

The optional third argument lets you specify an initial default input value.

If you have a list of completions you want to offer, you can pass that as the optional fourth argument:

#+BEGIN_SRC org * Next meeting at %(ocv/prmt “Location” ‘mtg-loc “the usual place” ‘mtg-locs) #+END_SRC

  • Acknowledgements

Very slightly modified from [[http://storax.github.io/blog/2016/05/02/org-capture-tricks/][an original idea and implementation code]] by [[http://storax.github.io][David Zuber]].

Related Repositories

org-capture-vars.el

org-capture-vars.el

User-defined capture variables and prompts for Org-mode ...