From: Whitfield Diffie <whitfield.diffie@sun.com>
Subject: Percent sign in message
Date: Sun, 10 Sep 2006 23:15:08 -0700 [thread overview]
Message-ID: <200609110615.k8B6F86U021306@ushabti.sfbay.sun.com> (raw)
Sunday 10 September 2006 at 23:03
I am sending this message to emacs-devel rather than bug-gnu-emacs
because, although I think this is arguable a bug, it could be fixed by
changing the documentation but the fix I propose is more substantial.
The command
(message "%")
produces the error
(error "Not enough arguments for format string")
because message hands its arguments directly to format and format makes
special use of percent signs. A reasonably careful look at the
documentation of format finds the warning that if you want a percent
in the format string, you should double it. That isn't so bad because
there is no reason to use format if you don't want the special way it
processes its string.
Message is another thing. It is perfectly reasonable to call message
to print a fixed string or, as produced the trouble, a string that is not
under the program's control. In my case, I have a function called
`describe-last-kbd-macro' that constructs a definition and calls message to
present it and my macro operated on comments in TeX. Clearly I could
pre-process the message to double the percent signs but it doesn't seem
that should be necessary.
What I propose is changing format so that it specially interprets as
many percent signs as it has arguments for and just passes the rest
verbatum, with a possible warning in the *Messages* buffer.
Whit
next reply other threads:[~2006-09-11 6:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-11 6:15 Whitfield Diffie [this message]
2006-09-11 6:38 ` Percent sign in message Michaël Cadilhac
2006-09-11 6:57 ` Whitfield Diffie
2006-09-11 7:18 ` David Kastrup
2006-09-11 8:26 ` Kim F. Storm
2006-09-11 14:07 ` Stefan Monnier
2006-09-11 19:57 ` Richard Stallman
2006-09-11 21:00 ` Stefan Monnier
2006-09-11 21:03 ` David Kastrup
2006-09-11 22:05 ` Stefan Monnier
2006-09-11 22:13 ` David Kastrup
2006-09-12 3:20 ` Stefan Monnier
2006-09-12 15:27 ` Richard Stallman
2006-09-12 15:37 ` David Kastrup
2006-09-19 19:39 ` Stuart D. Herring
2006-09-19 21:49 ` David Kastrup
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=200609110615.k8B6F86U021306@ushabti.sfbay.sun.com \
--to=whitfield.diffie@sun.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).