Article View: gnu.emacs.bug
Article #98572bug in interactive
From: king
Date: Wed, 05 Jun 1991 13:50
Date: Wed, 05 Jun 1991 13:50
29 lines
1658 bytes
1658 bytes
In an emacs 18.55.0 running under Berkeley UNIX, I defined
(defun insert-many-instances (format-string how-many)
(interactive "sformat to make string (%d must appear once): \np")
(while (> how-many 0)
(insert (format format-string current-gensym-number))
(setq current-gensym-number (1+ current-gensym-number))))
: when i then do C-U M-x insert-many-instances i get an error that backtraces
thus:
Signalling: (error "Format string wants too many arguments")
call-interactively(insert-many-instances)
(let ...)
execute-extended-command(insert-many-instances (4))
* call-interactively(execute-extended-command)
If i replace the interactive string with
"sformat to make string (%%d must appear once): \np"
[note the doubled %] it works just as i intend; the prompt only shows one %.
The documentation for interactive makes no mention of the string arg being a
format string.
Also, the documentation for format doesn't mention the use of a double % to get
a % into the output.
-dk
Technical Details
Message-ID:
<9106052150.AA04815@violin.reasoning.com.res_no_yp>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbageShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,6a092c34b144ef15,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1991-06-05 06:50:50 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbage From: king@VIOLIN.REASONING.COM Newsgroups: gnu.emacs.bug Subject: bug in interactive Message-ID: <9106052150.AA04815@violin.reasoning.com.res_no_yp> Date: 5 Jun 91 13:50:50 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: king@reasoning.com Distribution: gnu Organization: GNUs Not Usenet Lines: 29 Approved: bug-gnu-emacs@prep.ai.mit.edu