From: Paul Eggert <eggert@cs.ucla.edu>
To: Philipp Stephani <p.stephani2@gmail.com>,
Jean-Christophe Helary <jean.christophe.helary@gmail.com>,
emacs-devel <emacs-devel@gnu.org>
Subject: Re: i18n/l10n summary
Date: Sat, 3 Jun 2017 01:37:14 -0700 [thread overview]
Message-ID: <3931675f-e26c-2f14-b229-61f518816fff@cs.ucla.edu> (raw)
In-Reply-To: <CAArVCkR07CGOqz_XT5VGGQ9=gcVeCVvRPd4oRv3wSxXsSh2VSw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
Philipp Stephani wrote:
> Wrong example, try (format "%1$c %1$s" ?±)
Ouch. Fixing that (without adversely affecting performance) would be a bit of a
hassle. Not sure that it's worth it. For now let's just document the limitation.
I installed the attached.
>> And on further thought, the tradition for Emacs is to
>> document supported behavior and not worry about slowing Emacs down to
>> check for undocumented usage
>
> Would be great to break that tradition, but that's for another discussion.
Indeed.
[-- Attachment #2: 0001-Document-uniqueness-limitation-of-format.txt --]
[-- Type: text/plain, Size: 2443 bytes --]
From 0147cdd4d96f1eaeef720ee0b89bddd27eaf4233 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 3 Jun 2017 01:31:04 -0700
Subject: [PATCH] =?UTF-8?q?Document=20uniqueness=20limitation=20of=20?=
=?UTF-8?q?=E2=80=98format=E2=80=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* doc/lispref/strings.texi (Formatting Strings):
* src/editfns.c (Fformat):
Document that field numbers should be unique within a format.
---
doc/lispref/strings.texi | 7 ++++---
src/editfns.c | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index e80e778..f365c80 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -965,9 +965,10 @@ Formatting Strings
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")
diff --git a/src/editfns.c b/src/editfns.c
index 29af25a..a5088b0 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -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
--
2.7.4
next prev parent reply other threads:[~2017-06-03 8:37 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-28 5:29 i18n/l10n summary Jean-Christophe Helary
2017-05-28 14:27 ` Drew Adams
2017-05-28 14:36 ` Jean-Christophe Helary
2017-05-28 15:33 ` Eli Zaretskii
2017-06-05 12:55 ` Jean-Christophe Helary
2017-07-17 23:22 ` Jean-Christophe Helary
2017-07-22 12:48 ` Jean-Christophe Helary
2017-07-22 13:06 ` Eli Zaretskii
2017-07-22 13:45 ` Jean-Christophe Helary
2017-07-22 14:08 ` Eli Zaretskii
2017-07-22 23:54 ` Jean-Christophe Helary
2017-07-23 14:39 ` Eli Zaretskii
2017-07-23 23:29 ` Jean-Christophe Helary
2017-07-24 14:47 ` Eli Zaretskii
2017-07-24 15:34 ` Jean-Christophe Helary
2017-07-24 15:51 ` Eli Zaretskii
2017-07-24 16:08 ` Jean-Christophe Helary
2017-07-24 16:29 ` Eli Zaretskii
2017-07-24 16:48 ` Jean-Christophe Helary
2017-07-24 16:55 ` Eli Zaretskii
2017-05-31 22:18 ` Philipp Stephani
2017-05-31 22:29 ` Jean-Christophe Helary
2017-06-01 5:18 ` Paul Eggert
2017-06-01 8:17 ` Philipp Stephani
2017-06-01 23:20 ` Paul Eggert
2017-06-02 6:52 ` Philipp Stephani
2017-06-03 8:37 ` Paul Eggert [this message]
2017-06-03 9:12 ` Andreas Schwab
2017-06-03 9:34 ` Philipp Stephani
2017-06-04 15:54 ` Paul Eggert
2017-06-04 16:45 ` Eli Zaretskii
2017-06-04 18:37 ` Paul Eggert
2017-12-03 5:43 ` Paul Eggert
2017-06-01 14:21 ` Eli Zaretskii
2017-07-02 1:22 ` Jean-Christophe Helary
2017-07-02 2:34 ` Eli Zaretskii
2017-07-28 0:15 ` Byung-Hee HWANG (황병희, 黃炳熙)
2018-04-25 12:58 ` Jean-Christophe Helary
2018-09-21 4:18 ` Jean-Christophe Helary
[not found] <<AA86315D-1561-41EB-A349-63100C565E8D@gmail.com>
[not found] ` <<0aca6c65-4610-44c2-99c4-6cbe7aa68c9a@default>
[not found] ` <<83a85xgfo2.fsf@gnu.org>
2017-05-28 21:52 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3931675f-e26c-2f14-b229-61f518816fff@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=jean.christophe.helary@gmail.com \
--cc=p.stephani2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).