[slime-devel] Re: Console raw during a SLIME session

Helmut Eller heller at common-lisp.net
Fri Dec 8 21:16:36 UTC 2006


* Sean Charles [2006-12-08 17:44+0100] writes:

> So, does anybody know what I have to do to make it such that a single
> key press is all I need to get read-char to come back with the
> keypress inside SLIME+EMACS... it's a bit of a pain having to test it
> from the shell every time I do something major to the application.
> is there an even Lispier way of doing this, am I missing something,
> unaware of something... I have only been using Lisp for about four
> months now and the size of that HyperSpec still makes my brain hurt
> ;-)

A quit hack would be something like this:

(defun slime-raw-insert ()
  (interactive)
  (let ((char last-command-char))
    (goto-char slime-repl-input-end-mark)
    (insert char)
    (slime-repl-send-input nil)))

(dolist (key (where-is-internal 'self-insert-command slime-repl-read-mode-map))
  (define-key slime-repl-read-mode-map key 'slime-raw-insert))

but then you can't no longer edit the input.  Properly emulating a
terminal with raw mode would be quite a bit more work.


I think, that on SBCL/MacOS it should work if you start SBCL in the
terminal, load and start the Swank server from there, and connect to
it from Emacs with `M-x slime-connect'.  SB-SYS:*TTY* should then hold
the stream to the terminal in raw mode.  This way you still need to
switch windows, but at least you get proper terminal emulation.

Helmut.




More information about the slime-devel mailing list