Hi Darlan,
Darlan Cavalcante Moreira <[email protected]> writes:
> everything works as expected and a table in the headline with ID
> "someIDstring" is used. However, if I try
>
> ("f" "The template description" table-line
> (id some_variable)
> "this is the template content"
> :table-line-pos "II-1"
> :immediate-finish t)
Can you provide the full (setq org-capture-templates ...)
s-expression?
Did you tried this?
(setq org-capture-templates
`(("f" "The template description" table-line
(id ,some_variable)
"this is the template content"
:table-line-pos "II-1"
:immediate-finish t)))
> 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).
Yes, it expects a string.
> Is it possible to achieve what I want with the current org-capture
> implementation?
See above. The problem being, of course, that the capture template
for "f" will use some_variable *statically* -- if the value of the
some_variable variable changed after you evaluated the s-expression
(setq org-capture-templates ...) then the new value will not be
known.
> If not, consider this as a feature request.
What feature exactly? To allow a function here that would dynamically
set the id?
> 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).
If you want to use a function ,some_variable will not work, check
,@ constructs in the Elisp manual.
Thanks,
--
Bastien