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

Diff of /slime/swank.lisp

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

revision 1.260 by heller, Tue Nov 9 10:27:13 2004 UTC revision 1.261 by heller, Mon Nov 15 22:48:39 2004 UTC
# Line 169  Backend code should treat the connection Line 169  Backend code should treat the connection
169    ;; Maps: symbol -> indentation-specification    ;; Maps: symbol -> indentation-specification
170    (indentation-cache (make-hash-table :test 'eq) :type hash-table)    (indentation-cache (make-hash-table :test 'eq) :type hash-table)
171    ;; The list of packages represented in the cache:    ;; The list of packages represented in the cache:
172    (indentation-cache-packages '()))    (indentation-cache-packages '())
173      ;; The communication style used.
174      (communication-style nil :type (member nil :spawn :sigio :fd-handler))
175      )
176    
177  (defun print-connection (conn stream depth)  (defun print-connection (conn stream depth)
178    (declare (ignore depth))    (declare (ignore depth))
# Line 205  recently established one." Line 208  recently established one."
208    
209  (add-hook *new-connection-hook* 'notify-backend-of-connection)  (add-hook *new-connection-hook* 'notify-backend-of-connection)
210  (defun notify-backend-of-connection (connection)  (defun notify-backend-of-connection (connection)
211    (emacs-connected (connection.user-io connection)))    (declare (ignore connection))
212      (emacs-connected))
213    
214  ;;;; Helper macros  ;;;; Helper macros
215    
# Line 557  of the toplevel restart." Line 561  of the toplevel restart."
561                         client (lambda () (handle-request connection)))))                         client (lambda () (handle-request connection)))))
562                     ((eq (car *swank-state-stack*) :read-next-form))                     ((eq (car *swank-state-stack*) :read-next-form))
563                     (t (process-available-input client #'read-from-emacs)))))                     (t (process-available-input client #'read-from-emacs)))))
       (encode-message '(:use-sigint-for-interrupt) client)  
564        (setq *debugger-hook*        (setq *debugger-hook*
565              (lambda (c h)              (lambda (c h)
566                (with-reader-error-handler (connection)                (with-reader-error-handler (connection)
# Line 576  of the toplevel restart." Line 579  of the toplevel restart."
579    
580  (defun simple-serve-requests (connection)  (defun simple-serve-requests (connection)
581    (let ((socket-io (connection.socket-io connection)))    (let ((socket-io (connection.socket-io connection)))
     (encode-message '(:use-sigint-for-interrupt) socket-io)  
582      (with-reader-error-handler (connection)      (with-reader-error-handler (connection)
583        (loop (handle-request connection)))))        (loop (handle-request connection)))))
584    
# Line 621  of the toplevel restart." Line 623  of the toplevel restart."
623      connection))      connection))
624    
625  (defun create-connection (socket-io style)  (defun create-connection (socket-io style)
626    (initialize-streams-for-connection    (let ((c (ecase style
627     (ecase style               (:spawn
628       (:spawn                (make-connection :socket-io socket-io
629        (make-connection :socket-io socket-io                                 :read #'read-from-control-thread
630                         :read #'read-from-control-thread                                 :send #'send-to-control-thread
631                         :send #'send-to-control-thread                                 :serve-requests #'spawn-threads-for-connection
632                         :serve-requests #'spawn-threads-for-connection                                 :cleanup #'cleanup-connection-threads))
633                         :cleanup #'cleanup-connection-threads))               (:sigio
634       (:sigio                (make-connection :socket-io socket-io
635        (make-connection :socket-io socket-io                                 :read #'read-from-socket-io
636                         :read #'read-from-socket-io                                 :send #'send-to-socket-io
637                         :send #'send-to-socket-io                                 :serve-requests #'install-sigio-handler
638                         :serve-requests #'install-sigio-handler                                 :cleanup #'deinstall-sigio-handler))
639                         :cleanup #'deinstall-sigio-handler))               (:fd-handler
640       (:fd-handler                (make-connection :socket-io socket-io
641        (make-connection :socket-io socket-io                                 :read #'read-from-socket-io
642                         :read #'read-from-socket-io                                 :send #'send-to-socket-io
643                         :send #'send-to-socket-io                                 :serve-requests #'install-fd-handler
644                         :serve-requests #'install-fd-handler                                 :cleanup #'deinstall-fd-handler))
645                         :cleanup #'deinstall-fd-handler))               ((nil)
646       ((nil)                (make-connection :socket-io socket-io
647        (make-connection :socket-io socket-io                                 :read #'read-from-socket-io
648                         :read #'read-from-socket-io                                 :send #'send-to-socket-io
649                         :send #'send-to-socket-io                                 :serve-requests #'simple-serve-requests)))))
650                         :serve-requests #'simple-serve-requests)))))      (setf (connection.communication-style c) style)
651        (initialize-streams-for-connection c)
652        c))
653    
654    
655  ;;;; IO to Emacs  ;;;; IO to Emacs
# Line 916  If a protocol error occurs then a SLIME- Line 920  If a protocol error occurs then a SLIME-
920    (list (getpid)    (list (getpid)
921          (lisp-implementation-type)          (lisp-implementation-type)
922          (lisp-implementation-type-name)          (lisp-implementation-type-name)
923          (features-for-emacs)))          (features-for-emacs)
924            (connection.communication-style *emacs-connection*)))
925    
926    
927  ;;;; Reading and printing  ;;;; Reading and printing

Legend:
Removed from v.1.260  
changed lines
  Added in v.1.261

  ViewVC Help
Powered by ViewVC 1.1.5