From 7449276ba3bcf671bb07c19e39a66a94a94e8975 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 28 Jun 2004 02:43:25 +0000 Subject: [PATCH] Synch to No Gnus 200406280243. --- lisp/ChangeLog | 13 +++++++++++++ lisp/mm-util.el | 42 +++++++++++++++++++++++++----------------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea05ff3..0b52fe4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2004-06-28 Katsumi Yamaoka + + * mm-util.el (mm-mime-mule-charset-alist): Use shift_jis instead + of iso-2022-jp-2 for the katakana-jisx0201 mule charset; add new + entries for the mime charsets iso-2022-jp-3 and shift_jis. + (mm-coding-system-priorities): Use shift_jis and iso-8859-1 + instead of japanese-shift-jis and iso-latin-1 respectively in + order to share the default value with both Emacs and XEmacs-mule. + (mm-mule-charset-to-mime-charset): Make + mm-coding-system-priorities effective. + (mm-sort-coding-systems-predicate): Canonicalize coding-systems + while predicating of candidates upon the priorities. + 2004-06-27 Jesper Harder * gnus-sum.el (gnus-summary-make-menu-bar): Add diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 6bcc05f..cbaff05 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -233,8 +233,7 @@ In XEmacs, also return non-nil if CS is a coding system object." (iso-2022-jp-2 latin-iso8859-1 greek-iso8859-7 latin-jisx0201 japanese-jisx0208-1978 chinese-gb2312 japanese-jisx0208 - korean-ksc5601 japanese-jisx0212 - katakana-jisx0201) + korean-ksc5601 japanese-jisx0212) (iso-2022-int-1 latin-iso8859-1 greek-iso8859-7 latin-jisx0201 japanese-jisx0208-1978 chinese-gb2312 japanese-jisx0208 @@ -249,6 +248,9 @@ In XEmacs, also return non-nil if CS is a coding system object." chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5 chinese-cns11643-6 chinese-cns11643-7) + (iso-2022-jp-3 latin-jisx0201 japanese-jisx0208-1978 japanese-jisx0208 + japanese-jisx0213-1 japanese-jisx0213-2) + (shift_jis latin-jisx0201 katakana-jisx0201 japanese-jisx0208) ,(if (or (not (fboundp 'charsetp)) ;; non-Mule case (charsetp 'unicode-a) (not (mm-coding-system-p 'mule-utf-8))) @@ -312,9 +314,8 @@ Valid elements include: (if (boundp 'current-language-environment) (let ((lang (symbol-value 'current-language-environment))) (cond ((string= lang "Japanese") - ;; Japanese users may prefer iso-2022-jp to shift-jis. - '(iso-2022-jp iso-2022-jp-2 japanese-shift-jis - iso-latin-1 utf-8))))) + ;; Japanese users may prefer iso-2022-jp to shift_jis. + '(iso-2022-jp iso-2022-jp-2 shift_jis iso-8859-1 utf-8))))) "Preferred coding systems for encoding outgoing messages. More than one suitable coding system may be found for some text. @@ -340,16 +341,20 @@ mail with multiple parts is preferred to sending a Unicode one.") "Return the MIME charset corresponding to the given Mule CHARSET." (if (and (fboundp 'find-coding-systems-for-charsets) (fboundp 'sort-coding-systems)) - (let (mime) - (dolist (cs (sort-coding-systems - (copy-sequence - (find-coding-systems-for-charsets (list charset))))) - (unless mime - (when cs - (setq mime (or (coding-system-get cs :mime-charset) - (coding-system-get cs 'mime-charset)))))) + (let ((css (sort (sort-coding-systems + (find-coding-systems-for-charsets (list charset))) + 'mm-sort-coding-systems-predicate)) + cs mime) + (while (and (not mime) + css) + (when (setq cs (pop css)) + (setq mime (or (coding-system-get cs :mime-charset) + (coding-system-get cs 'mime-charset))))) mime) - (let ((alist mm-mime-mule-charset-alist) + (let ((alist (mapcar (lambda (cs) + (assq cs mm-mime-mule-charset-alist)) + (sort (mapcar 'car mm-mime-mule-charset-alist) + 'mm-sort-coding-systems-predicate))) out) (while alist (when (memq charset (cdar alist)) @@ -539,11 +544,14 @@ This affects whether coding conversion should be attempted generally." (let ((priorities (mapcar (lambda (cs) ;; Note: invalid entries are dropped silently - (and (coding-system-p cs) + (and (mm-coding-system-p cs) (coding-system-base cs))) mm-coding-system-priorities))) - (> (length (memq a priorities)) - (length (memq b priorities))))) + (and (mm-coding-system-p a) + (if (mm-coding-system-p b) + (> (length (memq (coding-system-base a) priorities)) + (length (memq (coding-system-base b) priorities))) + t)))) (defun mm-find-mime-charset-region (b e &optional hack-charsets) "Return the MIME charsets needed to encode the region between B and E. -- 1.7.10.4