(mm-charset-synonym-alist): Improve doc string.
authorReiner Steib <Reiner.Steib@gmx.de>
Tue, 11 Oct 2005 20:20:46 +0000 (20:20 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Tue, 11 Oct 2005 20:20:46 +0000 (20:20 +0000)
(mm-charset-override-alist): New variable.
(mm-charset-to-coding-system): Use it.

lisp/ChangeLog
lisp/mm-util.el

index 58da8a8..629ca96 100644 (file)
@@ -1,5 +1,9 @@
 2005-10-11  Reiner Steib  <Reiner.Steib@gmx.de>
 
+       * mm-util.el (mm-charset-synonym-alist): Improve doc string.
+       (mm-charset-override-alist): New variable.
+       (mm-charset-to-coding-system): Use it.
+
        * dgnushack.el (with-syntax-table): Add some URLs WRT the XEmacs bug.
 
 2005-10-04  David Hansen  <david.hansen@gmx.net>
index fc1edc7..f94e403 100644 (file)
@@ -195,7 +195,24 @@ system object in XEmacs."
            '((ks_c_5601-1987 . cp949))
          '((ks_c_5601-1987 . euc-kr))))
     )
-  "A mapping from invalid charset names to the real charset names.")
+  "A mapping from unknown or invalid charset names to the real charset names.")
+
+(defcustom mm-charset-override-alist
+  `((iso-8859-1 . windows-1252))
+  "A mapping from undesired charset names to their replacement.
+
+You may add pair like (iso-8859-1 . windows-1252) here,
+i.e. treat iso-8859-1 as windows-1252.  windows-1252 is a
+superset of iso-8859-1."
+  :type '(list (set :inline t
+                   (const (iso-8859-1 . windows-1252))
+                   (const (undecided  . windows-1252)))
+              (repeat :inline t
+                      :tag "Other options"
+                      (cons (symbol :tag "From charset")
+                            (symbol :tag "To charset"))))
+  :version "23.0" ;; No Gnus
+  :group 'mime)
 
 (defvar mm-binary-coding-system
   (cond
@@ -436,6 +453,9 @@ used as the line break code type of the coding system."
    ((or (null (mm-get-coding-system-list))
        (not (fboundp 'coding-system-get)))
     charset)
+   ;; Check override list quite early:
+   ((let ((cs (cdr (assq charset mm-charset-override-alist))))
+      (and cs (mm-coding-system-p cs) cs)))
    ;; ascii
    ((eq charset 'us-ascii)
     'ascii)