emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: No Wayman <iarchivedmywholelife@gmail.com>
To: emacs-orgmode@gnu.org
Cc: emacs-orgmode-request@gnu.org
Subject: Re: org-capture: question about function to create template
Date: Mon, 15 Mar 2021 12:57:15 -0400	[thread overview]
Message-ID: <87wnu8s60r.fsf@gmail.com> (raw)
In-Reply-To: <mailman.51.1615824031.880.emacs-orgmode@gnu.org>


> From: Joost Kremers <joostkremers@fastmail.fm>
> To: emacs-orgmode@gnu.org
> Subject: org-capture: question about function to create template
> Message-ID: <87eeggh0r5.fsf@fastmail.fm>
> Content-Type: text/plain
>
> Hi list,
>
> I've been looking at the =org-capture= mechanism a bit more 
> closely recently and
> noticed that in =org-capture-templates=, the template can also 
> be a function.
> This looks like a potentially useful feature, but I was 
> wondering if there's any
> way for this function to access the state of the ongoing capture 
> process.

The metadata for the template is stored in the `org-capture-plist' 
variable.


> Specifically, it would be useful for me if the function can find 
> out the key of
> the template that the user selected.

This is stored on the above plist as :key.

There are some corner cases to consider if you have overlapping 
capture processes.
You'll want to look into `org-capture-get' and 
`org-capture-current-plist' as well.

Depending on your needs you may find DOCT useful:

https://www.github.com/progfolio/doct





       reply	other threads:[~2021-03-15 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.51.1615824031.880.emacs-orgmode@gnu.org>
2021-03-15 16:57 ` No Wayman [this message]
2021-03-16  7:17 ` SOLVED: Problems while trying to load feature Ypo
2021-03-15 15:42 org-capture: question about function to create template Joost Kremers
2021-03-16  2:30 ` Ihor Radchenko
2021-03-16  9:36   ` Joost Kremers

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=87wnu8s60r.fsf@gmail.com \
    --to=iarchivedmywholelife@gmail.com \
    --cc=emacs-orgmode-request@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /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).