emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to use org-capture with "dynamic ID" targets?
@ 2013-01-16 22:38 Darlan Cavalcante Moreira
  2013-01-24 19:01 ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Darlan Cavalcante Moreira @ 2013-01-16 22:38 UTC (permalink / raw)
  To: emacs-orgmode


I'm trying to set-up some org-capture templates using the ID target
type. However, I need the ID to be determined either as the return value of
a function or as the value of a variable.

When I use a template such as
--8<---------------cut here---------------start------------->8---
("f" "The template description" table-line
    (id "someIDstring")
    "this is the template content"
    :table-line-pos "II-1"
    :immediate-finish t)
--8<---------------cut here---------------end--------------->8---

everything works as expected and a table in the headline with ID
"someIDstring" is used. However, if I try

--8<---------------cut here---------------start------------->8---
("f" "The template description" table-line
    (id some_variable)
    "this is the template content"
    :table-line-pos "II-1"
    :immediate-finish t)
--8<---------------cut here---------------end--------------->8---

or

--8<---------------cut here---------------start------------->8---
("f" "The template description" table-line
    (id (some_function))
    "this is the template content"
    :table-line-pos "II-1"
    :immediate-finish t)
--8<---------------cut here---------------end--------------->8---

then it does not work even if some_variable or (some_function) provides the
correct ID value. It seems that
(id something)
will always interpret "something" as a string (no matter if I put it inside
quotes or not).

Is it possible to achieve what I want with the current org-capture
implementation? If not, consider this as a feature request.

The reason behind this is that each month I want a different target table
for this capture template and I already implemented a function that returns
the correct ID. If I can somehow make the ID target type use the return
value of this function then this capture template will use the correct
table each month. If not, I would be forced to manually change the capture
template in the beginning of each month (something I will definitely
forget).


--
Darlan

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

end of thread, other threads:[~2013-01-29 14:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 22:38 How to use org-capture with "dynamic ID" targets? Darlan Cavalcante Moreira
2013-01-24 19:01 ` Bastien
2013-01-28 18:05   ` Darlan Cavalcante Moreira
2013-01-29  5:26     ` Eric Abrahamsen
2013-01-29 14:20       ` Darlan Cavalcante Moreira

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