From: Narendra Joshi <narendraj9@gmail.com>
To: Eric Thomas <eric@ericthomas.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Dynamic Org-capture Templates
Date: Sat, 04 Nov 2017 12:43:51 +0530 [thread overview]
Message-ID: <874lqa5xe8.fsf@gmail.com> (raw)
In-Reply-To: <CALxTFT5Q85PjKjn0O5M+Q3douvnAs_K_Cx2ZsBuZ6TfHrp0t5Q@mail.gmail.com> (Eric Thomas's message of "Fri, 3 Nov 2017 17:32:07 -0700")
Eric Thomas <eric@ericthomas.net> writes:
> Does anyone know how to approach creating dynamic Org-capture
> templates? I'm looking for IDO/Helm type of completion after a
> template has been selected. If string does not exist, it is created
> and added to future completions, similar to new files in emacs.
>
> Example:
>
> C-c c
> "a" (activity)
> Activity: math (<--need completion here)
> Topic: multiplication (<--need completion here)
> Date: 2017-09-11 (<--need default to todays date)
> Start time: 07:00 AM (<--need to define AM/PM easily)
> Duration: 20 (<--easier way to capture time?)
> Unit: mins
>
> And
>
> C-c c
> "a" (activity)
> Activity: physical education (<--again, completion starts as "ph.." is typed)
> Type: Yoga (<--completion)
> Class: Level 2 flow (<--completion)
> Date: 2017-09-11 (<--date picker of some kind)
> Start time: 07:00 AM (<--define AM/PM easily)
> Duration: 90 (<--easy method for capturing time)
> Unit: mins
>
>
> Maybe Org-capture templates are not the correct way to approach this?
> Any direction is appreciated.
From doc string for `org-capture-templates`:
%^{prompt} Prompt the user for a string and replace this sequence with it.
A default value and a completion table ca be specified like this:
%^{prompt|default|completion2|completion3|...}.
I think to get completion you would need to dynamically build the value
for `org-capture-templates` which would include the completion
candidates for reach field. I think that's not a great way to do
it. Someone else can suggest a better way, I think.
--
Narendra Joshi
prev parent reply other threads:[~2017-11-04 7:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-04 0:32 Dynamic Org-capture Templates Eric Thomas
2017-11-04 7:13 ` Narendra Joshi [this message]
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=874lqa5xe8.fsf@gmail.com \
--to=narendraj9@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=eric@ericthomas.net \
/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).