Commit 0147cdd4 authored by Paul Eggert's avatar Paul Eggert
Browse files

Document uniqueness limitation of ‘format’

* doc/lispref/strings.texi (Formatting Strings):
* src/editfns.c (Fformat):
Document that field numbers should be unique within a format.
parent 73635edb
......@@ -965,9 +965,10 @@ extra values to be formatted are ignored.
decimal number immediately after the initial @samp{%}, followed by a
literal dollar sign @samp{$}. It causes the format specification to
convert the argument with the given number instead of the next
argument. Field numbers start at 1. A format can contain either
numbered or unnumbered format specifications but not both, except that
@samp{%%} can be mixed with numbered specifications.
argument. Field numbers start at 1. A field number should differ
from the other field numbers in the same format. A format can contain
either numbered or unnumbered format specifications but not both,
except that @samp{%%} can be mixed with numbered specifications.
@example
(format "%2$s, %3$s, %%, %1$s" "x" "y" "z")
......
......@@ -3901,9 +3901,10 @@ where field is [0-9]+ followed by a literal dollar "$", flags is
followed by [0-9]+.
If a %-sequence is numbered with a field with positive value N, the
Nth argument is substituted instead of the next one. A format can
contain either numbered or unnumbered %-sequences but not both, except
that %% can be mixed with numbered %-sequences.
Nth argument is substituted instead of the next one. A field number
should differ from the other field numbers in the same format. A
format can contain either numbered or unnumbered %-sequences but not
both, except that %% can be mixed with numbered %-sequences.
The + flag character inserts a + before any positive number, while a
space inserts a space before any positive number; these flags only
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment