emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: Darlan Cavalcante Moreira <darcamo@gmail.com>
Cc: Orgmode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: Define capture template with dynamic id target
Date: Fri, 10 Jun 2011 07:31:43 +0200	[thread overview]
Message-ID: <87aadqjlq8.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <4df10e5c.4b6edc0a.1d4f.1a14@mx.google.com>

[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]

At Thu, 09 Jun 2011 15:18:00 -0300,
Darlan Cavalcante Moreira wrote:
>
>
> Hello List,
>
> I'm trying to create a few templates for org capture and I have found a
> weird behavior with the ID target type. It works OK if I use the ID
> directly like below
> #+begin_src emacs-lisp
>   (id "Junho2011Contas")
> #+end_src
> but it does not find the ID if I try to get it from a function, such as
> #+begin_src emacs-lisp
>   (id (get-me-an-org-id-for-the-month "Contas"))
> #+end_src

Org capture does not support executing a function in the ID target spec.

C-h v org-capture-templates RET

target       Specification of where the captured item should be placed.
             In Org-mode files, targets usually define a node.  Entries will
             become children of this node, other types will be added to the
             table or list in the body of this node.

             Most target specifications contain a file name.  If that file
             name is the empty string, it defaults to `org-default-notes-file'.
             A file can also be given as a variable, function, or Emacs Lisp
             form.

             Valid values are:

             (file "path/to/file")
                 Text will be placed at the beginning or end of that file

             (id "id of existing org entry")
                 File as child of this entry, or in the body of the entry

             ...

You might use the `function' target spec

             (function function-finding-location)
                Most general way, write your own function to find both
                file and location

HTH,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

  reply	other threads:[~2011-06-10  5:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 18:18 Define capture template with dynamic id target Darlan Cavalcante Moreira
2011-06-10  5:31 ` David Maus [this message]
2011-06-10 15:50   ` Darlan Cavalcante Moreira
2011-06-11  8:06     ` Aankhen

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=87aadqjlq8.wl%dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --cc=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).