From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Setting PROPERTIES in remember templates automatically Date: Fri, 27 Nov 2009 10:48:06 +0100 Message-ID: <87zl688fjd.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDxRE-0004TN-BQ for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 04:48:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDxR9-0004Mb-IO for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 04:48:27 -0500 Received: from [199.232.76.173] (port=54218 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDxR9-0004M8-9i for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 04:48:23 -0500 Received: from lo.gmane.org ([80.91.229.12]:47589) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NDxR8-0007mY-Hi for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 04:48:23 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NDxR5-0000Dw-U8 for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 10:48:19 +0100 Received: from p54af2603.dip0.t-ipconnect.de ([84.175.38.3]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 Nov 2009 10:48:19 +0100 Received: from tassilo by p54af2603.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 Nov 2009 10:48:19 +0100 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: emacs-orgmode@gnu.org 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 g]]") --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? Bye, Tassilo