mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-05 07:01:11 -08:00
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.
This commit is contained in:
parent
73635edb43
commit
0147cdd4d9
2 changed files with 8 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue