Since Luke has been very good about getting my wish items into slime, here, I think, is the last one that really prevents me from switching completely to slime from ilisp.
In ilisp, if you're in the debugger, pressing C-d pops one level of the debugger. In slime, I press C-d all the time, but cmucl sees a literal C-d and thinks end-of-file. Fortunately, cmucl doesn't exit.
And, since we're wishing right now, here's another feature from ilisp that I like and use once in a while. Comes in handy when you're testing different versions of cmucl, or comparing how different lisps behave.
Ilisp allows several buffers running at the same time. Each buffer is running a different lisp instance. This can be the same lisp or a different lisp implementation altogether.
Anyway, slime rocks!
Ray
On 25 Oct 2003, rtoy@earthlink.net wrote:
In ilisp, if you're in the debugger, pressing C-d pops one level of the debugger. In slime, I press C-d all the time, but cmucl sees a literal C-d and thinks end-of-file. Fortunately, cmucl doesn't exit.
I'll leave it up to others on whether to add this binding to sldb proper but this elisp in .emacs seems to do the trick if I understand correctly:
(defun my-slime-hook () (define-key sldb-mode-map "\C-d" 'sldb-abort))
(add-hook 'slime-mode-hook 'my-slime-hook)
This command is normally bound to 'a' in the debugger.
James
James Bielman wrote:
On 25 Oct 2003, rtoy@earthlink.net wrote:
I'll leave it up to others on whether to add this binding to sldb proper but this elisp in .emacs seems to do the trick if I understand correctly:
(defun my-slime-hook () (define-key sldb-mode-map "\C-d" 'sldb-abort))
(add-hook 'slime-mode-hook 'my-slime-hook)
This command is normally bound to 'a' in the debugger.
Although the above doesn't really work for me, I can live with using 'a' in the debugger, which, embarassingly, I didn't know about. Also, there's enough hints here and in ilisp that if I really wanted to do this, I think I could implement it myself. If I do so, I'll send a patch here.
Thanks!
Ray
Raymond Toy rtoy@earthlink.net writes:
James Bielman wrote:
On 25 Oct 2003, rtoy@earthlink.net wrote: I'll leave it up to others on whether to add this binding to sldb proper but this elisp in .emacs seems to do the trick if I understand correctly: (defun my-slime-hook () (define-key sldb-mode-map "\C-d" 'sldb-abort)) (add-hook 'slime-mode-hook 'my-slime-hook) This command is normally bound to 'a' in the debugger.
Although the above doesn't really work for me, I can live with using 'a' in the debugger, which, embarassingly, I didn't know about.
Actually, James's comments and code refer to our graphical debugger. Unfortunately you don't get to use that for evaluation in *inferior-lisp*, at least at the moment.
Have you tried it? e.g. "C-c : (/ 1 0) RET" in a lisp-mode buffer. There's a little glitch under XEmacs currently where you need to press RET on the '--more--' line to get the rest of the backtrace - in GNU you only have to move the point there.
You could use this code for more-or-less what you want in inf-lisp:
(defun inferior-slime-delete-char (arg) "Delete ARG characters, or invoke ABORT restart if at end of buffer." (interactive "p") (if (not (eobp)) (call-interactively 'delete-char (list arg)) (message "Invoking ABORT restart.") (comint-send-string (get-buffer-process (current-buffer)) "ABORT\n")))
(define-key inferior-slime-mode-map "\C-d" 'inferior-slime-delete-char)
Trouble is that then ^D will evaluate "ABORT" if you're not already in the debugger. ILISP handles this better somehow.
I'm not committing this change, it's a "customer special" :-). That command uses CMUCL's debugger listener syntax, and probably doesn't work for other Lisps. If we start adding fancy portable listener-based interactions, we'd be taking a step away from our socket-based style and towards ILISP. I prefer to only reinvent one wheel at a time :-)
What we really want is for you to use our fancy graphical debugger instead. It might be practical to make that usable in *inferior-lisp*, but I think the way forward is to write our own listener in Elisp that talks to Lisp through the socket. We should still support *inferior-lisp* as well as we reasonably can, and perhaps do a few more hacks to keep things usable before writing our listener :-)
Cheers, Luke
"Luke" == Luke Gorrie luke@bluetail.com writes:
Luke> What we really want is for you to use our fancy graphical debugger Luke> instead.
I am new to SLIME, what is this fancy graphical debugger you are talking about?
------------------------+----------------------------------------------------- Christian Lynbech | christian #@ defun #. dk ------------------------+----------------------------------------------------- Hit the philistines three times over the head with the Elisp reference manual. - petonic@hal.com (Michael A. Petonic)
Christian Lynbech christian.lynbech@ericsson.com writes:
"Luke" == Luke Gorrie luke@bluetail.com writes:
Luke> What we really want is for you to use our fancy graphical debugger Luke> instead.
I am new to SLIME, what is this fancy graphical debugger you are talking about?
The one depicted here:
http://www.bluetail.com/~luke/misc/lisp/slime-dbg.png
This is used automatically when you evaluate expressions using SLIME commands like `C-c :' and `C-M-x'. Currently it isn't used when you enter expressions in the *inferior-lisp* buffer.
The debugger is very nice. You can toggle viewing local variable information, jump to and highlight the relevant source expression, etc. Try `C-h m' in the debugger buffer for a list of commands.
-Luke
Luke Gorrie wrote:
Have you tried it? e.g. "C-c : (/ 1 0) RET" in a lisp-mode buffer. There's a little glitch under XEmacs currently where you need to press RET on the '--more--' line to get the rest of the backtrace - in GNU you only have to move the point there.
Ahh, this is cool. Don't have the fancy colorization though. Maybe because I have my font-lock stuff set to be just fonts instead of colors?
You could use this code for more-or-less what you want in inf-lisp:
(defun inferior-slime-delete-char (arg) "Delete ARG characters, or invoke ABORT restart if at end of buffer." (interactive "p") (if (not (eobp)) (call-interactively 'delete-char (list arg)) (message "Invoking ABORT restart.") (comint-send-string (get-buffer-process (current-buffer)) "ABORT\n")))
(define-key inferior-slime-mode-map "\C-d" 'inferior-slime-delete-char)
Trouble is that then ^D will evaluate "ABORT" if you're not already in the debugger. ILISP handles this better somehow.
This works very, very nicely! Thanks! And the easiest workaround is to use :ABORT instead of ABORT, so no gratuitous errors if at top-level. I think, but I'm not sure, that ilisp looks at the prompt. I know, thought, that ilisp looks at lisp prints out about restarts to figure which restart to use. There's a bug in ilisp about this too.
What we really want is for you to use our fancy graphical debugger instead. It might be practical to make that usable in *inferior-lisp*,
Yeah, but I find I still type things in directly to the listener. If you have a listener in elisp, that would be ok.
but I think the way forward is to write our own listener in Elisp that talks to Lisp through the socket. We should still support *inferior-lisp* as well as we reasonably can, and perhaps do a few more hacks to keep things usable before writing our listener :-)
I really appreciate your help in all this. I'm now just about ready to start using SLIME instead of ILISP now. :-)
Ray