emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] How to use org-capture with "dynamic ID" targets?


From: Darlan Cavalcante Moreira
Subject: [O] How to use org-capture with "dynamic ID" targets?
Date: Wed, 16 Jan 2013 19:38:42 -0300
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.3 Mule/6.0 (HANACHIRUSATO)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]