"Luke" == Luke Gorrie luke@bluetail.com writes:
Luke> This one's from comp.lang.lisp..
>> also, when i'm trying to do that in slime and defsystem asks if >> i want stuff recompiled i can't seem to be able to answer. i >> guess slime treats my pressing Return key specially and it >> never reaches the defsystem. is there a solution to this?
Luke> This is a bit tricky.
Luke> In general SLIME works with user input. When Lisp tries to Luke> read input, a message goes to Emacs saying "I want some user Luke> input", and while Lisp is expecting input pressing return in Luke> the REPL will do the right thing.
Luke> The difficulty here is that defsystem wants to read with a Luke> timeout so it is actually _polling_ for input, i.e. most of Luke> the time it is not actually trying to read, but is waiting a Luke> while before checking if input is available. That means that Luke> most of the time Emacs thinks Lisp doesn't want input and so Luke> it interprets user input as a REPL expression to be Luke> evaluated instead (since our REPL supports issuing commands Luke> in parallel).
aha, that clarifies the matters. thanks.
Luke> One solution could be to add some flow-control to the REPL Luke> and disable request piplining. Then we would buffer up user Luke> input until Lisp tells us whether it wants user input or the Luke> next REPL command. Maybe there's a better way.
Luke> The workaround for now is to hack defsystem so that it does Luke> a blocking read instead of polling. This loses the timeout Luke> feature:
Luke> (defun mk::read-char-wait (&optional (timeout 20) Luke> input-stream (eof-error-p t) eof-value) (declare (ignore Luke> timeout)) (read-char input-stream eof-error-p eof-value))
i see. how could i add this so that my lisp core has virgin version but slime "overloads" it with this one? is there some ~/.slime-init.lisp sort of thing?