[slime-devel] Coding systems: suggested change to slime-open-stream-to-lisp

Harald Hanche-Olsen hanche at math.ntnu.no
Fri Dec 30 22:05:33 UTC 2005

May I suggest the following patch to slime-open-stream-to-lisp:

--- slime.el	30 Dec 2005 19:26:22 +0100	1.574
+++ slime.el	30 Dec 2005 22:58:49 +0100	
@@ -2775,9 +2775,8 @@
             (list* '("<" . slime-mark-presentation-start-handler) 
                    '(">" . slime-mark-presentation-end-handler)
-    (set-process-coding-system stream 
-                               slime-net-coding-system 
-                               slime-net-coding-system)
+    (let ((pcs (process-coding-system (slime-current-connection))))
+      (set-process-coding-system stream (car pcs) (cdr pcs)))
     (when-let (secret (slime-secret))
       (slime-net-send secret stream))

It appears to solve the following problem.  I have not changed
slime-net-coding-system from its default value, but I have

(setf slime-lisp-implementations
      '((sbcl ("sbcl") :coding-system utf-8-unix)
	(cmucl ("cmucl") :coding-system iso-latin-1-unix)))

So when I run sbcl, coding systems on the emacs and sbcl sides match
for input and printing of values, but there is a mismatch on printing
from lisp code:  The sbcl side uses utf-8, while the emacs side
assumes latin-1.

Quick demo (first good, second bad):

cl-user> #\å
cl-user> (format t "~C" #\å)

- Harald

More information about the slime-devel mailing list