User-defined capture variables and prompts for Org-mode
Emacs Lisp
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.org
org-capture-vars.el

README.org

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:

* JIRA Ticket %(ocv/prmt "JIRA Ticket No." 'jr-no)
  I have to do the following stuff:
** Triage %(progn jr-no)

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:

* JIRA Ticket 4321
  I have to do the following stuff:
** Triage 4321

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:

* Next meeting at %(ocv/prmt "Location" 'mtg-loc "the usual place" 'mtg-locs)

Acknowledgements

Very slightly modified from an original idea and implementation code by David Zuber.