all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Suggestion for tiniest of manual changes
@ 2017-08-19  5:06 Peter Tomhas
  2017-08-19  9:12 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Tomhas @ 2017-08-19  5:06 UTC (permalink / raw)
  To: emacs-orgmode

Not being a lisp programmer, I stubbed my toe on section "9.1.3.2
Template expansion" of the manual. I was trying to use %\1, %\2 etc,
following the instructions in the second last item of the big table:
where it says:

%\1 ... %\N   Insert the text entered at the Nth %^{prompt}, where N is
                    a number, starting from 1.

I inserted %\1 into my template and it failed to work. After a wee
while of testing what might be wrong, I guessed that I needed to
backslash-escape the backslash, and it worked. Because that escaping
is both: a. made necessary (as I understand it) by the %\N  being in a
string; and b. only /ever/ invoked within a string, at first I
considered this to be a documentation bug, and I reckoned the entry
should start, "%\\1 ... %\\N". However, it was explained to me on
Reddit[1], that anyone who knows lisp would know to add the escape,
and that having %\\1 in the documentation could cause them to try to
use %\\\\1.

Sounds reasonable, but I still think at least a footnote could help.
As far as I can make out, the current texinfo is as follows:

%\1 @dots{} %\N @r{Insert the text entered at the Nth
%^@{@var{prompt}@}, where @code{N} is}
            @r{a number, starting from 1.}

Perhaps that could become something like (apologies for poorly
formatted texinfo):

%\1 @dots{} %\N @r{Insert the text entered at the Nth
%^@{@var{prompt}@}, where @code{N} is}
            @r{a number, starting from 1.@footnote{As is standard in elisp,
to insert a backslash character within a string, as is required here, it is
necessary to escape it with another backslash. So to insert %\1, %\2 and so
on, one should actually insert %\\1, %\\2, etc.}}

pt

[1] https://www.reddit.com/r/orgmode/comments/6uksnz/orgcapture_in_templates_n_needs_to_be_n/dltsth0/n

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-19  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-19  5:06 Suggestion for tiniest of manual changes Peter Tomhas
2017-08-19  9:12 ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.