(mm-sort-coding-systems-predicate): Convert elements
authorReiner Steib <Reiner.Steib@gmx.de>
Sun, 13 Apr 2003 20:43:11 +0000 (20:43 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Sun, 13 Apr 2003 20:43:11 +0000 (20:43 +0000)
of `mm-coding-system-priorities' to base coding system.

lisp/ChangeLog
lisp/mm-util.el

index 23f3223..32b7fd9 100644 (file)
@@ -1,5 +1,8 @@
 2003-04-13  Reiner Steib  <Reiner.Steib@gmx.de>
 
+       * mm-util.el (mm-sort-coding-systems-predicate): Convert elements
+       of `mm-coding-system-priorities' to base coding system.
+
        * gnus-sum.el: Added coding cookie ("middle dot" in
        gnus-summary-morse-message).
 
index a705b82..921f7a1 100644 (file)
@@ -502,8 +502,14 @@ If the charset is `composition', return the actual one."
        (not inconvertible))))
 
 (defun mm-sort-coding-systems-predicate (a b)
-  (> (length (memq a mm-coding-system-priorities))
-     (length (memq b mm-coding-system-priorities))))
+  (let ((priorities
+        (mapcar (lambda (cs)
+                  ;; Note: invalid entries are dropped silently
+                  (and (coding-system-p cs)
+                       (coding-system-base cs)))
+                mm-coding-system-priorities)))
+    (> (length (memq a priorities))
+       (length (memq b priorities)))))
 
 (defun mm-find-mime-charset-region (b e &optional hack-charsets)
   "Return the MIME charsets needed to encode the region between B and E.