diff lisp/mule/mule-cmds.el @ 4621:127dbf03e1af

Correct a test failure uncovered by the last commit. lisp/ChangeLog addition: 2009-02-17 Aidan Kehoe <kehoea@parhasard.net> * mule/mule-cmds.el (finish-set-language-environment): Correct this function, don't try to format non-control characters with ^ followed by their value plus (char-int ?@).
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 17 Feb 2009 13:42:36 +0000
parents ba06a6cae484
children 02b7c7189041
line wrap: on
line diff
--- a/lisp/mule/mule-cmds.el	Tue Feb 17 13:39:25 2009 +0000
+++ b/lisp/mule/mule-cmds.el	Tue Feb 17 13:42:36 2009 +0000
@@ -780,14 +780,16 @@
          (setq string (decode-coding-string (string entry)
                                             invalid-sequence-coding-system))
          (when (= 1 (length string))
+	   ;; Treat Unicode error sequence chars as the octets
+	   ;; corresponding to those on disk:
+	   (setq unicode-error-lookup
+		 (get-char-table (aref string 0)
+				 unicode-error-default-translation-table))
+	   (when unicode-error-lookup
+	     (setq string (format "%c" unicode-error-lookup)))
            ;; Treat control characters specially:
-           (cond
-            ((string-match "^[\x00-\x1f\x80-\x9f]$" string)
-             (setq string (format "^%c" (+ ?@ (aref string 0)))))
-            ((setq unicode-error-lookup
-                   (get-char-table (aref string 0)
-                                   unicode-error-default-translation-table))
-             (setq string (format "^%c" (+ ?@ unicode-error-lookup))))))
+	   (when (string-match "^[\x00-\x1f\x80-\x9f]$" string)
+	     (setq string (format "^%c" (+ ?@ (aref string 0))))))
          (setq glyph (make-glyph (vector 'string :data string)))
          (set-glyph-face glyph 'unicode-invalid-sequence-warning-face)
          (put-char-table key glyph disp-table)