emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Darlan Cavalcante Moreira <darcamo@gmail.com>
To: emacs-orgmode@gnu.org
Subject: How to use org-capture with "dynamic ID" targets?
Date: Wed, 16 Jan 2013 19:38:42 -0300	[thread overview]
Message-ID: <50f72bf5.669dec0a.7b79.ffffdcb0@mx.google.com> (raw)


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	other threads:[~2013-01-16 22:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16 22:38 Darlan Cavalcante Moreira [this message]
2013-01-24 19:01 ` How to use org-capture with "dynamic ID" targets? Bastien
2013-01-28 18:05   ` Darlan Cavalcante Moreira
2013-01-29  5:26     ` Eric Abrahamsen
2013-01-29 14:20       ` Darlan Cavalcante Moreira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50f72bf5.669dec0a.7b79.ffffdcb0@mx.google.com \
    --to=darcamo@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).