? swank-lispworks.ufasl
? doc/html
? doc/slime.fns
? doc/slime.kys
? doc/slime.vrs
Index: swank-lispworks.lisp
===================================================================
RCS file: /project/slime/cvsroot/slime/swank-lispworks.lisp,v
retrieving revision 1.117
diff -c -w -r1.117 swank-lispworks.lisp
*** swank-lispworks.lisp	17 Sep 2008 06:19:49 -0000	1.117
--- swank-lispworks.lisp	25 Sep 2008 01:28:04 -0000
***************
*** 71,83 ****
  (defimplementation close-socket (socket)
    (comm::close-socket (socket-fd socket)))
  
  (defimplementation accept-connection (socket 
                                        &key external-format buffering timeout)
!   (declare (ignore buffering timeout external-format))
    (let* ((fd (comm::get-fd-from-socket socket)))
      (assert (/= fd -1))
!     (make-instance 'comm:socket-stream :socket fd :direction :io 
!                    :element-type 'base-char)))
  
  (defun set-sigint-handler ()
    ;; Set SIGINT handler on Swank request handler thread.
--- 71,106 ----
  (defimplementation close-socket (socket)
    (comm::close-socket (socket-fd socket)))
  
+ (defvar *current-external-format* nil
+   "Holds the external format which this inferior lispworks uses
+    to communicate with emacs and compile files.")
+ 
  (defimplementation accept-connection (socket
                                        &key external-format buffering timeout)
!   (declare (ignore buffering))
    (let* ((fd (comm::get-fd-from-socket socket)))
      (assert (/= fd -1))
!     (assert (valid-external-format-p external-format))
!     (prog1 (cond ((member (first external-format) '(:latin-1 :ascii))
!                   (make-instance 'comm:socket-stream
!                                  :socket fd
!                                  :direction :io
!                                  :read-timeout timeout
!                                  :element-type 'base-char))
!                  ((not (member :flexi-streams *features*))
!                   (error "Cannot use external format ~A without having installed flexi-streams in the inferior-lisp."
!                          external-format))
!                  (t
!                   (flexi-streams:make-flexi-stream
!                    (make-instance 'comm:socket-stream
!                                   :socket fd
!                                   :direction :io
!                                   :read-timeout timeout
!                                   :element-type '(unsigned-byte 8))
!                    :external-format (apply #'flexi-streams:make-external-format external-format))))
!       (setf *current-external-format* external-format))))
! 
! 
  
  (defun set-sigint-handler ()
    ;; Set SIGINT handler on Swank request handler thread.
***************
*** 87,92 ****
--- 110,120 ----
  
  ;;; Coding Systems
  
+ (defun valid-external-format-p (external-format)
+   (member external-format *external-format-to-coding-system*
+           :test #'equal :key #'car))
+ 
+ 
  (defvar *external-format-to-coding-system*
    '(((:latin-1 :eol-style :lf)
       "latin-1-unix" "iso-latin-1-unix" "iso-8859-1-unix")
***************
*** 448,464 ****
  		  :location location
  		  :original-condition condition)))
  
  (defun compile-from-temp-file (string filename)
    (unwind-protect
         (progn
! 	 (with-open-file (s filename :direction :output :if-exists :supersede)
  	   (write-string string s)
  	   (finish-output s))
! 	 (let ((binary-filename (compile-file filename :load t)))
             (when binary-filename
               (delete-file binary-filename))))
      (delete-file filename)))
  
  (defun dspec-function-name-position (dspec fallback)
    (etypecase dspec
      (cons (let ((name (dspec:dspec-primary-name dspec)))
--- 476,498 ----
  		  :location location
  		  :original-condition condition)))
  
+ 
+ 
  (defun compile-from-temp-file (string filename)
    (unwind-protect
         (progn
! 	 (with-open-file (s filename :direction :output
!                                      :if-exists :supersede
!                                      :external-format *current-external-format*)
! 
  	   (write-string string s)
  	   (finish-output s))
! 	 (let ((binary-filename (compile-file filename :load t :external-format  *current-external-format*)))
             (when binary-filename
               (delete-file binary-filename))))
      (delete-file filename)))
  
+ 
  (defun dspec-function-name-position (dspec fallback)
    (etypecase dspec
      (cons (let ((name (dspec:dspec-primary-name dspec)))
