From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Barton Subject: Using Properties in Capture Templates. Date: Sat, 19 Jan 2013 08:32:15 +0000 Message-ID: <50FA5A0F.2080009@wilkesley.net> Reply-To: ian@manor-farm.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwTqp-0002QX-9G for emacs-orgmode@gnu.org; Sat, 19 Jan 2013 03:32:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwTqd-0007v4-Fq for emacs-orgmode@gnu.org; Sat, 19 Jan 2013 03:32:31 -0500 Received: from mail2.wilkesley.net ([109.74.196.44]:46438 helo=li40-130.members.linode.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwTqd-0007uy-9r for emacs-orgmode@gnu.org; Sat, 19 Jan 2013 03:32:19 -0500 Received: from [192.168.0.58] (unknown [46.33.134.31]) (Authenticated sender: lists@wilkesley.net) by li40-130.members.linode.com (Postfix) with ESMTPSA id 983AB39805 for ; Sat, 19 Jan 2013 08:32:17 +0000 (GMT) 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 want to create a capture template which prompts for certain properties in a property draw, but alos creates some other properties without prompting for a value. However, I am having trouble mixing properties which are entered by the user and blank properties. The following example shows what I mean: #+begin_src emacs-lisp (defun capture-letter-file (path) (let ((name (read-string "File name: "))) (expand-file-name (format "%s-%s.org" (format-time-string "%Y-%m-%d") name) path))) ("z" "Letter template" plain (file (capture-letter-file "~/dropbox/org/org_files/letters")) "#+STARTUP: showall indent\n#+STARTUP: hidestars\n#+OPTIONS: H:2 num:nil tags:nil toc:nil timestamps:nil\n* Letter\n:PROPERTIES:\n:to_address:%^{salutation}p %^{to_name}p %^{subject}p %^{the_closing}p:END:\n ") #+end_src This produces: #+STARTUP: showall indent #+STARTUP: hidestars #+OPTIONS: H:2 num:nil tags:nil toc:nil timestamps:nil * Letter :PROPERTIES: :salutation: aaa :to_name: bbb :subject: ccc :the_closing: zzz :END: :to_address: :END: Note the two :END: values and the :to_address: is placed outside the values for which the user was prompted. I have tried omitting the :PROPERTIES: and :END: from the template and letting org create them, but still end up with the :to_address: property being placed outside the property draw. Ian.