all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Percent sign in message
@ 2006-09-11  6:15 Whitfield Diffie
  2006-09-11  6:38 ` Michaël Cadilhac
  0 siblings, 1 reply; 16+ messages in thread
From: Whitfield Diffie @ 2006-09-11  6:15 UTC (permalink / 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

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

end of thread, other threads:[~2006-09-19 21:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-11  6:15 Percent sign in message Whitfield Diffie
2006-09-11  6:38 ` 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

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.