[slime-cvs] CVS update: slime/slime.el
Luke Gorrie
lgorrie at common-lisp.net
Fri Oct 31 19:28:00 UTC 2003
Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv24703
Modified Files:
slime.el
Log Message:
Tweaked debugger window management somewhat: the window configuration
is saved when the debugger is first entered and then restored when the
idle state is reached.
(slime-interrupt, slime-quit): Only send the quit/interrupt
message to Lisp if it is in fact evaluating something for us. This
fixes a protocol bug reported by Paolo Amoroso.
Added (require 'pp).
Date: Fri Oct 31 14:27:59 2003
Author: lgorrie
Index: slime/slime.el
diff -u slime/slime.el:1.62 slime/slime.el:1.63
--- slime/slime.el:1.62 Fri Oct 31 11:51:53 2003
+++ slime/slime.el Fri Oct 31 14:27:59 2003
@@ -54,6 +54,7 @@
(require 'inf-lisp)
(require 'cl)
+(require 'pp)
(require 'hyperspec)
(when (featurep 'xemacs)
(require 'overlay))
@@ -591,8 +592,8 @@
;;; Inferior CL Setup: compiling and connecting to Swank
-(defvar slime-connect-retry-timer nil
- "Timer object for connection retries.")
+(defvar slime-startup-retry-timer nil
+ "Timer object while waiting for an inferior-lisp to start.")
(defun slime ()
"Start an inferior^_superior Lisp and connect to its Swank server."
@@ -989,10 +990,16 @@
(defvar slime-stack-eval-tags nil
"List of stack-tags of continuations waiting on the stack.")
+(defvar sldb-saved-window-configuration nil
+ "Window configuration before the debugger was entered.")
+
(slime-defstate slime-idle-state ()
"Idle state. The only event allowed is to make a request."
((activate)
(assert (= sldb-level 0))
+ (when sldb-saved-window-configuration
+ (set-window-configuration sldb-saved-window-configuration)
+ (setq sldb-saved-window-configuration nil))
(slime-repl-maybe-prompt))
((:emacs-evaluate form-string package-name continuation)
(slime-output-evaluate-request form-string package-name)
@@ -1025,6 +1032,8 @@
(when (member tag slime-stack-eval-tags)
(throw tag `(:aborted))))))
((:debug level condition restarts stack-depth frames)
+ (when (zerop sldb-level)
+ (setq sldb-saved-window-configuration (current-window-configuration)))
(slime-push-state
(slime-debugging-state level condition restarts stack-depth frames)))
((:emacs-interrupt)
@@ -1136,6 +1145,10 @@
"Return true if Lisp is busy processing a request."
(eq (slime-state-name (slime-current-state)) 'slime-evaluating-state))
+(defun slime-evaluating-p ()
+ "Return true if Lisp is evaluating a request for Emacs."
+ (slime-busy-p))
+
(defun slime-idle-p ()
"Return true if Lisp is idle."
(eq (slime-state-name (slime-current-state)) 'slime-idle-state))
@@ -2527,11 +2540,15 @@
(defun slime-interrupt ()
(interactive)
- (slime-dispatch-event '(:emacs-interrupt)))
+ (if (slime-evaluating-p)
+ (slime-dispatch-event '(:emacs-interrupt))
+ (error "Not evaluating - nothing to interrupt.")))
(defun slime-quit ()
(interactive)
- (slime-dispatch-event '(:emacs-quit)))
+ (if (slime-evaluating-p)
+ (slime-dispatch-event '(:emacs-quit))
+ (error "Not evaluating - nothing to quit.")))
(defun slime-set-package (package)
(interactive (list (slime-read-package-name "Package: "
@@ -2882,8 +2899,11 @@
(defun sldb-cleanup ()
(let ((sldb-buffer (get-buffer "*sldb*")))
(when sldb-buffer
- (delete-windows-on sldb-buffer)
- (kill-buffer sldb-buffer))))
+ (if (> sldb-level 1)
+ (with-current-buffer sldb-buffer
+ (let ((inhibit-read-only t))
+ (erase-buffer)))
+ (kill-buffer sldb-buffer)))))
(defun sldb-quit ()
(interactive)
More information about the slime-cvs
mailing list