From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: Define capture template with dynamic id target Date: Thu, 09 Jun 2011 15:18:00 -0300 Message-ID: <4df10e5c.4b6edc0a.1d4f.1a14@mx.google.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([140.186.70.92]:34271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUjo1-0006t8-4j for emacs-orgmode@gnu.org; Thu, 09 Jun 2011 14:18:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUjny-0007AA-UO for emacs-orgmode@gnu.org; Thu, 09 Jun 2011 14:18:09 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:55815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUjny-00079o-AC for emacs-orgmode@gnu.org; Thu, 09 Jun 2011 14:18:06 -0400 Received: by vws4 with SMTP id 4so1847508vws.0 for ; Thu, 09 Jun 2011 11:18:05 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Orgmode Mailing List 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 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." (interactive) (concat (get-current-month) (get-current-year) categoryName) ) #+end_src -- Darlan