[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31314: 26.1; using % escapes in prompt for interactive
From: |
Lars Ingebrigtsen |
Subject: |
bug#31314: 26.1; using % escapes in prompt for interactive |
Date: |
Sat, 13 Jul 2019 17:19:40 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
"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 in Thread] |
Current Thread |
[Next in Thread] |
- bug#31314: 26.1; using % escapes in prompt for interactive,
Lars Ingebrigtsen <=