/[slime]/slime/swank.lisp
ViewVC logotype

Diff of /slime/swank.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.678 by sboukarev, Thu Dec 17 06:25:00 2009 UTC revision 1.679 by trittweiler, Thu Dec 17 10:15:19 2009 UTC
# Line 998  This is an optimized way for Lisp to del Line 998  This is an optimized way for Lisp to del
998           ;; We explicitly rebind (and do not look at user's           ;; We explicitly rebind (and do not look at user's
999           ;; customization), so sldb-quit will always be our restart           ;; customization), so sldb-quit will always be our restart
1000           ;; for rex requests.           ;; for rex requests.
1001           (let ((*sldb-quit-restart* (find-restart 'abort)))           (let ((*sldb-quit-restart* (find-restart 'abort))
1002             . ,body)                 (*toplevel-restart-available* t))
1003               (declare (special *toplevel-restart-available*))
1004               ,@body)
1005         (abort (&optional v)         (abort (&optional v)
1006           :report "Return to SLIME's top level."           :report "Return to SLIME's top level."
1007           (declare (ignore v))           (declare (ignore v))
1008           (force-user-output)           (force-user-output)
1009           ,k))))           ,k))))
1010    
1011    (defun top-level-restart-p ()
1012      ;; FIXME: this could probably be done better; previously this used
1013      ;; *SLDB-QUIT-RESTART* but we cannot use that anymore because it's
1014      ;; exported now, and might hence be bound globally.
1015      ;;
1016      ;; The caveat is that for slime rex requests, we do not want to use
1017      ;; the global value of *sldb-quit-restart* because that might be
1018      ;; bound to terminate-thread, and hence `q' in the debugger would
1019      ;; kill the repl thread.
1020      (boundp '*toplevel-restart-available*))
1021    
1022  (defun handle-requests (connection &optional timeout)  (defun handle-requests (connection &optional timeout)
1023    "Read and process :emacs-rex requests.    "Read and process :emacs-rex requests.
1024  The processing is done in the extent of the toplevel restart."  The processing is done in the extent of the toplevel restart."
1025    (cond ((eq *emacs-connection* connection)    (cond ((top-level-restart-p)
1026           ;; *sldb-quit-restart* isn't bound here on *communication-style* NIL           (assert (boundp '*sldb-quit-restart*))
1027           ;; (assert (boundp '*sldb-quit-restart*))           (assert *emacs-connection*)
1028           (process-requests timeout))           (process-requests timeout))
1029          (t          (t
1030           (tagbody           (tagbody
1031              start            start
1032              (with-top-level-restart (connection (go start))              (with-top-level-restart (connection (go start))
1033                (process-requests timeout))))))                (process-requests timeout))))))
1034    

Legend:
Removed from v.1.678  
changed lines
  Added in v.1.679

  ViewVC Help
Powered by ViewVC 1.1.5