[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Setting PROPERTIES in remember templates automatically

From: Tassilo Horn
Subject: [Orgmode] Setting PROPERTIES in remember templates automatically
Date: Fri, 27 Nov 2009 10:48:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Hi all,

in my remember templates, I'd like to set some PROPERTIES to the value
of some org-remember escape sequences.  Till now, I did that by defining
a template like that:

  ("NORMAL"  ?n "* %?\n  %i\n  :PROPERTIES:\n  :created: %U\n  :END:")

This works, but templates become very large quickly.  And I don't like
that I have to do the indentation on my own.

Ok, now I have a new usecase.  I want to set a property if some escape
sequence is non-nil.  Or more concrete: I want to set a property :link:
if the template escape sequence %a has a value.

Therefore, I tried this template using the %(sexp) escape:

  ("NORMAL"  ?n
   "* %?\n  %i %(org-set-property \"created\" \"%U\")
               %(org-set-property \"annotation\" \"%a\")")

Unfortunately, when I select this template, emacs hangs and I have to
hit C-g.  At that point, I get this expansion in my remember buffer:

--8<---------------cut here---------------start------------->8---
* %?
   %(org-set-property "created" "[2009-11-27 Fri 10:38]")
   %(org-set-property "annotation"
"[[file:~/News/drafts/drafts/4::hit%20C%20g][file:~/News/drafts/drafts/4::hit C 
--8<---------------cut here---------------end--------------->8---

What I'd like to have is something like the existing

  %^{prop}p   Prompt the user for a value for property `prop'

but more like

  %{prop,escape}p   Insert property `prop' with value taken from escape,
                    if that is non-nil

With this

  "%{created,U} %{link,a}"

in a template would always create a :created: property with an inactive
timestamp, and :link: would only be inserted, if there is an annotation
for that remember invocation.

What do you think?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]