[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Dynamic Org-capture Templates
From: |
Narendra Joshi |
Subject: |
Re: [O] Dynamic Org-capture Templates |
Date: |
Sat, 04 Nov 2017 12:43:51 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Eric Thomas <address@hidden> 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