(mm-coding-system-priorities): Protect against nil value
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 14 Jan 2009 00:52:01 +0000 (00:52 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 14 Jan 2009 00:52:01 +0000 (00:52 +0000)
 of current-language-environment.

lisp/ChangeLog
lisp/mm-util.el

index f96e653..358854d 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-14  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-util.el (mm-coding-system-priorities): Protect against nil value
+       of current-language-environment.
+
 2009-01-13  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * nnfolder.el (nnfolder-read-folder): Check if most-positive-fixnum is
index c1fb1a6..403d967 100644 (file)
@@ -840,14 +840,16 @@ Valid elements include:
   "A table of the difference character between ISO-8859-X and ISO-8859-15.")
 
 (defcustom mm-coding-system-priorities
-  (if (boundp 'current-language-environment)
-      (let ((lang (symbol-value 'current-language-environment)))
-       (cond (;; In XEmacs 21.5 it may be the one like "Japanese (UTF-8)".
-              (string-match "\\`Japanese" lang)
-              ;; Japanese users prefer iso-2022-jp to euc-japan or
-              ;; shift_jis, however iso-8859-1 should be used when
-              ;; there are only ASCII text and Latin-1 characters.
-              '(iso-8859-1 iso-2022-jp iso-2022-jp-2 shift_jis utf-8)))))
+  (let ((lang (if (boundp 'current-language-environment)
+                 (symbol-value 'current-language-environment))))
+    (cond (;; XEmacs without Mule but with `file-coding'.
+          (not lang) nil)
+         ;; In XEmacs 21.5 it may be the one like "Japanese (UTF-8)".
+         ((string-match "\\`Japanese" lang)
+          ;; Japanese users prefer iso-2022-jp to euc-japan or
+          ;; shift_jis, however iso-8859-1 should be used when
+          ;; there are only ASCII text and Latin-1 characters.
+          '(iso-8859-1 iso-2022-jp iso-2022-jp-2 shift_jis utf-8))))
   "Preferred coding systems for encoding outgoing messages.
 
 More than one suitable coding system may be found for some text.