Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

(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).
  • Loading branch information...
commit 295af72f32a4fd454eec468eb8df0321e61e1b62 1 parent 20e37d0
Luke Gorrie authored
Showing with 27 additions and 2 deletions.
  1. +8 −0 ChangeLog
  2. +19 −2 slime.el
8 ChangeLog
View
@@ -1,3 +1,11 @@
+2003-10-29 Luke Gorrie <luke@bluetail.com>
+
+ * slime.el (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).
+
2003-10-25 Luke Gorrie <luke@bluetail.com>
* Everywhere: Changed the connection setup to use a dynamic
21 slime.el
View
@@ -55,6 +55,7 @@
(require 'inf-lisp)
(require 'cl)
(require 'hyperspec)
+(require 'pp)
(when (featurep 'xemacs)
(require 'overlay))
(unless (fboundp 'define-minor-mode)
@@ -271,6 +272,14 @@ A prefix argument disables this behaviour."
(insert ")")))
(comint-send-input))
+(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 "Pop LISP one level")
+ (comint-send-string (get-buffer-process (current-buffer))
+ "abort\n")))
;;;;; Key bindings
@@ -1159,6 +1168,10 @@ Loops until the result is thrown to our caller, or the user aborts."
"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-ping ()
"Check that communication works."
(interactive)
@@ -2350,11 +2363,15 @@ the current index when the selection is completed."
(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: "
Please sign in to comment.
Something went wrong with that request. Please try again.