🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.emacs
Article #8194

GNU Emacs special form "interactive"

#8194
From: David Ellis
Date: Fri, 30 Dec 1988 17:40
38 lines
1839 bytes
To have a GNU Emacs command prompt for string argument input using a fixed 
prompt string, the command should include in its body the form

	(interactive "s(This is a prompt string) : ")

The given prompt string is printed in the minibuffer, and the user's string
response typed in will be assigned as the value of the argument to the command.

What I'd like to do is have a function taking an argument that gets
inserted into a prompt string.  If I call (foo "type A"), I want
to have a prompt string that looks like

	(This is a type A prompt string) :

I can do this if I can get the special form "interactive" to take as its
argument a string-valued expression in place of a specific string, for
example

	(interactive (format "s(This is a %s prompt string) : " foo-arg))

Unfortunately, GNU Emacs rewards this effort with the error message

	Wrong type argument: listp, "s(This is a Type A prompt string) : "

saying that "interactive" expects a list (huh?) but has been given a string.

Trying a macro expansion within the scope of the "interactive" form fails
in a similar way.

I can do essentially the same thing via the function "read-string", but
is it possible to do this through the form "interactive"?

----
David Ellis
Digital Equipment Corporation -- BXB1-1/D03 
85 Swanson Road, Boxboro MA 01719 -- (617) 264-5073
Usenet:  {ucbvax,allegra,decvax}!decwrl!ultra.dec.com!ellis
ARPA:    ellis%ultra.dec@decwrl.dec.com
Technical Details
Message-ID: <8812301512.AA10827@decwrl.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!husc6!purdue!decwrl!ultra.dec.com!ellis

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!husc6!purdue!decwrl!ultra.dec.com!ellis
From: ellis@ultra.dec.com (David Ellis)
Newsgroups: comp.emacs
Subject: GNU Emacs special form "interactive"
Message-ID: <8812301512.AA10827@decwrl.dec.com>
Date: 30 Dec 88 17:40:00 GMT
Organization: Digital Equipment Corporation
Lines: 38