Below is a patch to show the current debug level in the REPL, when it's > 0
Index: ChangeLog =================================================================== RCS file: /project/slime/cvsroot/slime/ChangeLog,v retrieving revision 1.443 diff -u -F^(def -r1.443 ChangeLog --- ChangeLog 29 Jun 2004 22:07:00 -0000 1.443 +++ ChangeLog 30 Jun 2004 04:23:33 -0000 @@ -1,3 +1,10 @@ +2004-06-29 Thomas Burdick tfb@OCF.Berkeley.EDU + + * slime.el: Indicate when the REPL is in the debugger's context + (slime-debug-level): new connection var + (slime-dispatch-event): set slime-debug-level to match *sldb-level* + (slime-repl-insert-prompt): show debug-level in prompt when > 0 + 2004-06-30 Luke Gorrie luke@bluetail.com
* NEWS: Wrote preliminary release notes for alpha-1. Index: slime.el =================================================================== RCS file: /project/slime/cvsroot/slime/slime.el,v retrieving revision 1.346 diff -u -F^(def -r1.346 slime.el --- slime.el 29 Jun 2004 20:17:05 -0000 1.346 +++ slime.el 30 Jun 2004 04:23:46 -0000 @@ -1561,6 +1561,9 @@ (defmacro slime-def-connection-var (varn (slime-def-connection-var slime-use-sigint-for-interrupt nil "If non-nil use a SIGINT for interrupting.")
+(slime-def-connection-var slime-debug-level 0 + "The current level of recursive debugging.") +
;; XXX pending continuations are not removed if Lisp crashes. @@ -1602,9 +1605,11 @@ (defun slime-dispatch-event (event &opti (sldb-activate thread level)) ((:debug thread level condition restarts frames) (assert thread) + (setf (slime-debug-level) level) (sldb-setup thread level condition restarts frames)) ((:debug-return thread level) (assert thread) + (setf (slime-debug-level) (1- level)) (sldb-exit thread level)) ((:emacs-interrupt thread) (cond ((slime-use-sigint-for-interrupt) (slime-send-sigint)) @@ -2168,7 +2173,9 @@ (defun slime-repl-insert-prompt (result (slime-insert-propertized '(face slime-repl-result-face) result) (unless (bolp) (insert "\n")) (let ((prompt-start (point)) - (prompt (format "%s> " (slime-lisp-package)))) + (prompt (if (> (slime-debug-level) 0) + (format "%s [%d]> " (slime-lisp-package) (slime-debug-level)) + (format "%s> " (slime-lisp-package))))) (slime-propertize-region '(face slime-repl-prompt-face read-only t
"Thomas F. Burdick" tfb@OCF.Berkeley.EDU writes:
Below is a patch to show the current debug level in the REPL, when it's > 0
The patch is problematic for multithreaded Lisps; it would display if *some* thread is currently debugged. Would that be useful?
Helmut.
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
"Thomas F. Burdick" tfb@OCF.Berkeley.EDU writes:
Below is a patch to show the current debug level in the REPL, when it's > 0
The patch is problematic for multithreaded Lisps; it would display if *some* thread is currently debugged. Would that be useful?
i do ocassionaly forget that some thread has a debugger open, so this is a nice reminder that something is amis, and i applied it. however, now that you mention it, this may not be the best way to go about it.
Marco Baringer mb@bese.it writes:
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
"Thomas F. Burdick" tfb@OCF.Berkeley.EDU writes:
Below is a patch to show the current debug level in the REPL, when it's > 0
The patch is problematic for multithreaded Lisps; it would display if *some* thread is currently debugged. Would that be useful?
i do ocassionaly forget that some thread has a debugger open, so this is a nice reminder that something is amis, and i applied it. however, now that you mention it, this may not be the best way to go about it.
I've backed it out for now since it caused the problem Paolo reported just now. Let's think about it a bit more.
-Luke
Luke Gorrie luke@bluetail.com writes:
I've backed it out for now since it caused the problem Paolo reported just now. Let's think about it a bit more.
Works fine now, thanks.
Paolo
Luke Gorrie writes:
Marco Baringer mb@bese.it writes:
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
"Thomas F. Burdick" tfb@OCF.Berkeley.EDU writes:
Below is a patch to show the current debug level in the REPL, when it's > 0
The patch is problematic for multithreaded Lisps; it would display if *some* thread is currently debugged. Would that be useful?
i do ocassionaly forget that some thread has a debugger open, so this is a nice reminder that something is amis, and i applied it. however, now that you mention it, this may not be the best way to go about it.
I've backed it out for now since it caused the problem Paolo reported just now. Let's think about it a bit more.
Hmm, I wasn't thinking of threads at all when I was thinking about this. What I was going for was an indication that the current REPL prompt will be evaluating in a non-toplevel dynamic environment.
I don't use any multithreaded Lisps with SLIME -- what I'd expect is that there'd be a thread for communication, and one for evaluating things from the REPL; in that case, we could just keep track of the debug level of that thread. I remember seeing talk about not being able to have multiple REPLs open, so I'm guessing when the there's no way of getting a listener for another thread, when presented with a debugger? The only multithreaded lisp I've used much is MCL :-)