emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Darlan Cavalcante Moreira <darcamo@gmail.com>
To: Orgmode Mailing List <emacs-orgmode@gnu.org>
Subject: Define capture template with dynamic id target
Date: Thu, 09 Jun 2011 15:18:00 -0300	[thread overview]
Message-ID: <4df10e5c.4b6edc0a.1d4f.1a14@mx.google.com> (raw)

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

All the get-me-an-org-id-for-the-month function does is returning
"MonthnameYearArgument", in this case it returns "Junho2011Contas". The
definition is given below
#+begin_src emacs-lisp
  (defun get-me-an-org-id-for-the-month (categoryName)
    "Used only in my template for the expenses of the month. It
  return a suitable ID for the month sub-headline."
    (concat (get-current-month) (get-current-year) categoryName)


             reply	other threads:[~2011-06-09 18:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 18:18 Darlan Cavalcante Moreira [this message]
2011-06-10  5:31 ` Define capture template with dynamic id target David Maus
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:

  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=4df10e5c.4b6edc0a.1d4f.1a14@mx.google.com \
    --to=darcamo@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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