From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: How to use org-capture with "dynamic ID" targets? Date: Wed, 16 Jan 2013 19:38:42 -0300 Message-ID: <50f72bf5.669dec0a.7b79.ffffdcb0@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 ([208.118.235.92]:40865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvbdC-000555-G8 for emacs-orgmode@gnu.org; Wed, 16 Jan 2013 17:38:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvbdB-0002PU-ET for emacs-orgmode@gnu.org; Wed, 16 Jan 2013 17:38:50 -0500 Received: from mail-ye0-f181.google.com ([209.85.213.181]:63000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvbdB-0002PO-8W for emacs-orgmode@gnu.org; Wed, 16 Jan 2013 17:38:49 -0500 Received: by mail-ye0-f181.google.com with SMTP id m11so314730yen.12 for ; Wed, 16 Jan 2013 14:38:48 -0800 (PST) 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: emacs-orgmode@gnu.org 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