[slime-devel] prompting the user from Lisp
Taylor Campbell
campbell at mumble.net
Sun Feb 12 08:59:53 UTC 2006
The SLIME protocol currently provides, I believe, two operations for
reading input from the Emacs user: the READ-STRING mechanism and a
simple Y-OR-N-P device. In order to prompt the user for specific
input, one must send a string to Emacs and then parse a string read
from Emacs, but this is all line-oriented and provides no fancy input
mechanisms on the user's side, such as completion, so it's hard to
offer a convenient prompt to the user from the Lisp side, such as in
restart functions.
Does it sound like a good idea to define a (:PROMPT <prompt string>
<input type>) RPC to be called from Lisp? For instance, a USE-VALUE
restart might send (:PROMPT "Value to use instead:" EXPRESSION) to
request input from the user, rather than printing the prompt directly
to standard output and reading from standard input, as is usually done
now. This way, Emacs would be given more leeway in presenting the
prompt -- e.g., it might use the typein window instead of cluttering
the REPL buffer --, and it would allow for completion, editing not
restricted to lines (like the usual REPL prompt), &c.
It is probably pretty easy to implement; I'll experiment with it soon,
but I wondered what others thought about the matter.
More information about the slime-devel
mailing list