From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Roland Winkler" <winkler@gnu.org>
Cc: 31314@debbugs.gnu.org
Subject: bug#31314: 26.1; using % escapes in prompt for interactive
Date: Sat, 13 Jul 2019 17:19:40 +0200 [thread overview]
Message-ID: <875zo6uflf.fsf@mouse.gnus.org> (raw)
In-Reply-To: <22174.9715.409176.23270@gargle.gargle.HOWL> (Roland Winkler's message of "Sun, 29 Apr 2018 18:34:54 -0500")
"Roland Winkler" <winkler@gnu.org> writes:
> Running the following command interactively in emacs -Q
>
> (defun foo-num (n1 n2)
> "Display numbers N1 and N2."
> (interactive "nNumber 1: \nnNumber 1: %e, Number 2: ")
> (message "Number 1: %9.2e, Number 2: %e" n1 n2))
>
> yields the error message
>
> Format specifier doesn?FFE2?FF80?FF99t match argument type
>
> The problem is the `%e' apearing in the prompt for `interactive'.
> If this is replaced by a generic `%s' everything works fine.
>
> The docstring of `interactive' says that the % escapes can be used
> as in calls of `format', which sugests to me that these escapes
> should match the data types of the arguments that have already been
> read. Yet it seems that in this context the previously read
> arguments are interpreted as strings. So either the docstring of
> `interactive' should say that one may use %s escapes for all types
> of arguments or something else should be fixed to make this work
> with any type of arguments.
I changed the doc string to say "%s", since that's apparently the only
thing allowed currently. Extending `interactive' to allow
other types may be nice, though.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
prev parent reply other threads:[~2019-07-13 15:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-29 23:34 bug#31314: 26.1; using % escapes in prompt for interactive Roland Winkler
2019-07-13 15:19 ` Lars Ingebrigtsen [this message]
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=875zo6uflf.fsf@mouse.gnus.org \
--to=larsi@gnus.org \
--cc=31314@debbugs.gnu.org \
--cc=winkler@gnu.org \
/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).