[slime-cvs] CVS update: slime/swank.lisp
Helmut Eller
heller at common-lisp.net
Tue Jan 13 22:49:35 UTC 2004
Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv15040
Modified Files:
swank.lisp
Log Message:
(*swank-in-background*): New variable.
(start-server): Start swank in background, depending on *swank-in-background*.
Date: Tue Jan 13 17:49:34 2004
Author: heller
Index: slime/swank.lisp
diff -u slime/swank.lisp:1.94 slime/swank.lisp:1.95
--- slime/swank.lisp:1.94 Tue Jan 13 13:17:48 2004
+++ slime/swank.lisp Tue Jan 13 17:49:34 2004
@@ -117,14 +117,26 @@
(defvar *close-swank-socket-after-setup* nil)
(defvar *use-dedicated-output-stream* t)
+(defvar *swank-in-background* nil)
(defun start-server (port-file)
(let ((socket (create-socket 0)))
(announce-server-port port-file (local-port socket))
(let ((client (accept-connection socket)))
(close-socket socket)
- (let ((connection (init-connection client)))
- (loop until (handle-request connection))))))
+ (let ((connection (create-connection client)))
+ (ecase *swank-in-background*
+ (:fd-handler
+ (emacs-connected)
+ (add-input-handler client (lambda () (handle-request connection))))
+ (:spawn
+ (spawn (lambda ()
+ (emacs-connected)
+ (loop until (handle-request connection)))
+ :name "Swank"))
+ ((nil)
+ (emacs-connected)
+ (loop until (handle-request connection))))))))
(defun announce-server-port (file port)
(with-open-file (s file
@@ -133,10 +145,6 @@
:if-does-not-exist :create)
(format s "~S~%" port))
(simple-announce-function port))
-
-(defun init-connection (socket-io)
- (emacs-connected)
- (create-connection socket-io))
(defun create-connection (socket-io)
(let ((output-fn (make-output-function socket-io))
More information about the slime-cvs
mailing list