emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Dynamic Org-capture Templates
@ 2017-11-04  0:32 Eric Thomas
  2017-11-04  7:13 ` Narendra Joshi
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Thomas @ 2017-11-04  0:32 UTC (permalink / raw)
  To: emacs-orgmode

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.

Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Dynamic Org-capture Templates
  2017-11-04  0:32 Dynamic Org-capture Templates Eric Thomas
@ 2017-11-04  7:13 ` Narendra Joshi
  0 siblings, 0 replies; 2+ messages in thread
From: Narendra Joshi @ 2017-11-04  7:13 UTC (permalink / raw)
  To: Eric Thomas; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-04  7:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-04  0:32 Dynamic Org-capture Templates Eric Thomas
2017-11-04  7:13 ` Narendra Joshi

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).