Prev: new version of emacs's command frequency report
Next: Work at Home- Earn $4,000 Weekly With Email Reading Jobs
From: Tim X on 14 Feb 2010 17:23 Petter Gustad <newsmailcomp6(a)gustad.com> writes: > What is the current suggested method for using UTF-8 strings with > Slime/Emacs/SBCL? > > I'm using: > > echo $LC_CTYPE > en_US.UTF-8 > > (stream-external-format *standard-output*) > returns: > > :UTF-8 > > In emacs: > > (require 'slime) > (set-language-environment "UTF-8") > (setq slime-net-coding-system 'utf-8-unix) > (setq inferior-lisp-program "sbcl") > > > But entering an UTF-8 string causes it to crash (copied from an UTF-8 > buffer with a "u" in the bottom left corner"): > > MYPACKAGE> "Skates" > "Skates" > MYPACKAGE> "Skøyter" > "Skøyter" > > In *Messages* I see: > > Connecting to Swank on port 5555.. [2 times] > Connected. Hack and be merry! > Toggling font-lock-mode off; better pass an explicit argument. > Please type y, n, or !: > Loading cl-indent...done > Mark set [2 times] > error in process filter: let*: Wrong type argument: listp, :presentation-end > error in process filter: Wrong type argument: listp, :presentation-end > > In my REPL I observe: > > dispatch-event: (:WRITE-STRING "\"Skates\"" :REPL-RESULT) > WRITE: (:write-string "\"Skates\"" :repl-result) > dispatch-event: (:PRESENTATION-END 64 :REPL-RESULT) > WRITE: (:presentation-end 64 :repl-result) > dispatch-event: (:WRITE-STRING " > " :REPL-RESULT) > WRITE: (:write-string " > " :repl-result) > wait-for-event: (COMMON-LISP:OR (:EMACS-REX . SWANK::_) (:EMACS-CHANNEL-SEND . S > WANK::_)) NIL > dispatch-event: (:RETURN #<SB-THREAD:THREAD "repl-thread" RUNNING {1002565141}> > (:OK NIL) 5) > WRITE: (:return (:ok nil) 5) > READ: "(:emacs-rex (swank:listener-eval \"\\\"Sk\x00C3\x00B8yter\\\" > \") \"ENMILLIONKRONER\" :repl-thread 6)" > dispatch-event: (:EMACS-REX (SWANK:LISTENER-EVAL "\"Sk\x00C3\x00B8yter\" > ") "ENMILLIONKRONER" :REPL-THREAD 6) > send-event: #<SB-THREAD:THREAD "repl-thread" RUNNING {1002565141}> (:EMACS-REX ( > SWANK:LISTENER-EVAL "\"Sk\x00C3\x00B8yter\" > ") "ENMILLIONKRONER" 6) > wait-for-event: (COMMON-LISP:OR (:EMACS-REX . SWANK::_) (:EMACS-CHANNEL-SEND . S > WANK::_)) NIL > dispatch-event: (:PRESENTATION-START 65 :REPL-RESULT) > WRITE: (:presentation-start 65 :repl-result) > dispatch-event: (:WRITE-STRING "\"Sk\x00C3\x00B8yter\"" :REPL-RESULT) > WRITE: (:write-string "\"Sk\x00C3\x00B8yter\"" :repl-result) > dispatch-event: (:PRESENTATION-END 65 :REPL-RESULT) > WRITE: (:presentation-end 65 :repl-result) > dispatch-event: (:WRITE-STRING " > " :REPL-RESULT) > WRITE: (:write-string " > " :repl-result) > dispatch-event: (:RETURN #<SB-THREAD:THREAD "repl-thread" RUNNING {1002565141}> (:OK NIL) 6) > WRITE: (:return (:ok nil) 6) > close-connection: Short read: length=6 count=1 ... > > > This will crash in Slime, but works in the REPL: > > (coerce (loop for c in (list #\S #\k #\LATIN_SMALL_LETTER_O_WITH_STROKE #\y #\t #\e #\r) collect c) 'string) > > > Emacs "22.3.1" > Slime ChangeLog 2009-12-03 > SBCL 1.0.19-gentoo > > Any ideas? > First thing I'd do is uprade to emacs 23. A lot of the character encoding subsystems was re-written for emacs 23 and is now much cleaner. Tim -- tcross (at) rapttech dot com dot au |