[slime-cvs] CVS slime

heller heller at common-lisp.net
Sun Aug 27 11:01:43 UTC 2006


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv28542

Modified Files:
	swank.lisp 
Log Message:
(input-available-p, process-available-input): Use READ-CHAR-NO-HANG
instead of LISTEN because LISTEN suddenly returns false in SBCL 0.9.??
even if we are called from a fd-handler and the OPEN-STREAM-P returns
true.


--- /project/slime/cvsroot/slime/swank.lisp	2006/08/25 15:44:07	1.395
+++ /project/slime/cvsroot/slime/swank.lisp	2006/08/27 11:01:43	1.396
@@ -748,10 +748,19 @@
   (loop (handle-request connection)))
 
 (defun process-available-input (stream fn)
-  (loop while (and (open-stream-p stream) 
-                   (listen stream))
+  (loop while (input-available-p stream)
         do (funcall fn)))
 
+(defun input-available-p (stream)
+  ;; return true iff we can read from STREAM without waiting or if we
+  ;; hit EOF
+  (let ((c (read-char-no-hang stream nil :eof)))
+    (cond ((not c) nil)
+          ((eq c :eof) t)
+          (t 
+           (unread-char c stream)
+           t))))
+
 ;;;;;; Signal driven IO
 
 (defun install-sigio-handler (connection)
@@ -781,15 +790,15 @@
 		   ((eq (car *swank-state-stack*) :read-next-form))
 		   (t 
 		    (process-available-input client #'read-from-emacs)))))
-      ;; handle sigint
-      (install-debugger-globally
-       (lambda (c h)
-         (with-reader-error-handler (connection)
-           (block debugger
-             (with-connection (connection)
-               (swank-debugger-hook c h)
-               (return-from debugger))
-             (abort)))))
+      ;;;; handle sigint
+      ;;(install-debugger-globally
+      ;; (lambda (c h)
+      ;;   (with-reader-error-handler (connection)
+      ;;     (block debugger
+      ;;       (with-connection (connection)
+      ;;	 (swank-debugger-hook c h)
+      ;;	 (return-from debugger))
+      ;;       (abort)))))
       (add-fd-handler client #'handler)
       (handler))))
 
@@ -5034,8 +5043,5 @@
 			  (load source-file)
 			  nil)))
 	     (and (next-method-p) (call-next-method))))))
-  
 
-;; Local Variables:
-;; eval: (font-lock-add-keywords 'lisp-mode '(("(\\(defslimefun\\)\\s +\\(\\(\\w\\|\\s_\\)+\\)"  (1 font-lock-keyword-face) (2 font-lock-function-name-face))))
-;; End:
+;;; swank.lisp ends here




More information about the slime-cvs mailing list