From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org-capture question/suggestion Date: Wed, 23 Jun 2010 10:05:52 +0200 Message-ID: <37587748-A08E-4F7C-A1F6-F842CDB3BC9A@gmail.com> References: <877hlqetr8.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=41725 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORKy7-0005Do-Pt for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 04:06:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORKy6-00036h-JC for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 04:05:59 -0400 Received: from mail-wy0-f179.google.com ([74.125.82.179]:53363) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORKy6-00036a-EJ for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 04:05:58 -0400 Received: by wyb38 with SMTP id 38so802734wyb.38 for ; Wed, 23 Jun 2010 01:05:57 -0700 (PDT) In-Reply-To: <877hlqetr8.fsf@thinkpad.tsdh.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tassilo Horn Cc: emacs-orgmode@gnu.org On Jun 22, 2010, at 9:45 PM, Tassilo Horn wrote: > Hi, > > as already said, I really like the new org-capture interface. But > there's one thing concerning the templates, which might be optimized a > bit. > > I want to add certain information accessible with template escapes as > properties. So as an example, I have a template like this: > > ("t" "TODO" entry > (file "/home/horn/repos/org/remember.org") > "* TODO %?\n :PROPERTIES:\n :created: %U\n :link: %a\n :END:\n > %i") > > The creation date %U is always there, so that's no problem. But the > link accessible with %a may be nil. Then, I really don't want to > have a > :link: property. Currently, I simply delete that line before filing > the > item. That's a bit inconvenient, and that I have to deal with > indentation in the template is another inconvenience. And it won't > work > when my capture template doesn't create a new entry, but appends to an > existing one. In that case, properties should be appended to existing > properties, too. > > So what I would love to see was a possibility to have property > escapes, > which use the property API and only add properties that have a value. > Then the property API would handle the correct indentation and > everything else. James wrote to me that he will try to adapt his template-filling code so that org-capture can use it. Among other things, this will make use of the normal property API, and it will make the entire template stuff extensible so that you can even write your own special functions. This will be very useful, I am looking forward to a lot. > > Maybe, a good syntax would be %:propname:X, where X is one of the > normal > escapes without the leading %. Then I could write the template above > like that: > > ("t" "TODO" entry > (file "/home/horn/repos/org/remember.org") > "* TODO %?\n %i %:created:U %:link:a") > > Well, I don't really care about the syntax. Maybe it's better to > specify properties outside the template, because they won't be > inserted > at the exact position defined in the template anyway, especially if > type > is not 'entry. So how about something like that: > > ("t" "TODO" entry > (file "/home/horn/repos/org/remember.org") > "* TODO %?\n %i" > :properties (("created" "%U") > ("link" "%a"))) His looks very good. James, are you seeing this? THis would be an interesting way to specify values for some properties, and then prompt for others. - Carsten