From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: 9.1.3.2 Template expansion: documentation issue Date: Sun, 22 Jan 2017 14:56:32 +0100 Message-ID: <874m0rb3lb.fsf@nicolasgoaziou.fr> References: <54129f99a63355eb324a3191e4001d1d@mail-n.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVIdK-0007vW-O3 for emacs-orgmode@gnu.org; Sun, 22 Jan 2017 08:56:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVIdH-0005US-Kq for emacs-orgmode@gnu.org; Sun, 22 Jan 2017 08:56:38 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:46306) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cVIdH-0005Tn-EK for emacs-orgmode@gnu.org; Sun, 22 Jan 2017 08:56:35 -0500 In-Reply-To: <54129f99a63355eb324a3191e4001d1d@mail-n.franken.de> (Karl Eichwalder's message of "Mon, 16 Jan 2017 19:20:11 +0100") 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" To: Karl Eichwalder Cc: emacs-orgmode@gnu.org Hello, Karl Eichwalder writes: > In 9.1.3.2 Template expansion, you say: > > %\n Insert the text entered at the nth %^{PROMPT}, where > =E2=80=98n=E2=80=99 is > > but in my 25.1.1, you must use "%\\n". No, you mustn't. The placeholder really is "%\n", but Elisp require backslash characters to be escaped in strings. So, when you write your template as a string, you use "%\\n" because it is the only way to have "%\n". > Maybe, it is also worth noting that > > %^{PROP}p Prompt the user for a value for property PROP. > > will get inserted at the end of a list of properties, but white-space > will stay > in place: > > :PROP_A: a > %^{PROP}p > :PROP_Z: z > > =3D=3D> > > :PROP_A: a > > :PROP_Z: z > :PROP: foo > > To avoid white-space issues and an unexpected sorting order, you must > write (and you lose the preset values): > > :PROPERTIES:%^{PROP_A}p%^{PROP}p%^{PROP_Z}p You are mis-using %^{prop}p. Granted, `org-capture-templates' docstring is not particularly clear on this point. Unlike other placeholders %^{prop}p can be used anywhere in the template, since it delegates its job to `org-entry-put'. As a consequence, you shouldn't put it where you expect the property to be inserted. Besides, there is no order in properties drawers, so there is no guarantee that `org-entry-put' will preserve yours. Would you want to suggest a better wording to explain this in `org-capture-templates' docstring (and in the related part of the manual)? Regards, --=20 Nicolas Goaziou