X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmm-util.el;h=1f124e7558151e765b361dda16d00751c09dba95;hb=0563df167689ba46e219f7915c6f5b321da614ce;hp=c3d237a024891a88a5fd50f17f58e92d08625ef1;hpb=f309f11e6f2b7335fc4306aef04545c2a40f6e42;p=elisp%2Fgnus.git- diff --git a/lisp/mm-util.el b/lisp/mm-util.el index c3d237a..1f124e7 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -24,13 +24,14 @@ ;;; Code: +(eval-when-compile (require 'cl)) +(eval-when-compile (require 'gnus-clfns)) (eval-when-compile (require 'static)) -(eval-when-compile (require 'cl)) (require 'mail-prsvr) (defvar mm-mime-mule-charset-alist - '((us-ascii ascii) + `((us-ascii ascii) (iso-8859-1 latin-iso8859-1) (iso-8859-2 latin-iso8859-2) (iso-8859-3 latin-iso8859-3) @@ -73,7 +74,13 @@ chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5 chinese-cns11643-6 chinese-cns11643-7) - (utf-8 unicode-a unicode-b unicode-c unicode-d unicode-e)) + ,(if (or (not (fboundp 'charsetp)) ;; non-Mule case + (not (fboundp 'coding-system-p)) + (charsetp 'unicode-a) + (not (coding-system-p 'mule-utf-8))) + '(utf-8 unicode-a unicode-b unicode-c unicode-d unicode-e) + ;; If we have utf-8 we're in Mule 5+. + (delete 'ascii (coding-system-get 'mule-utf-8 'safe-charsets)))) "Alist of MIME-charset/MULE-charsets.") (eval-and-compile @@ -124,7 +131,7 @@ (setq idx (1+ idx))) string))) (string-as-unibyte . identity) - ))) + (multibyte-string-p . ignore)))) (eval-and-compile (defalias 'mm-char-or-char-int-p @@ -301,13 +308,14 @@ If the charset is `composition', return the actual one." (setq mail-parse-mule-charset (or (car (last (assq mail-parse-charset mm-mime-mule-charset-alist))) + ;; Fixme: don't fix that! 'latin-iso8859-1))) mail-parse-mule-charset))))))) (defun mm-mime-charset (charset) "Return the MIME charset corresponding to the MULE CHARSET." (if (eq charset 'unknown) - (error "8-bit characters are found in the message, please specify charset.")) + (error "The message contains non-printable characters, please use attachment.")) (if (and (fboundp 'coding-system-get) (fboundp 'get-charset-property)) ;; This exists in Emacs 20. (or @@ -340,7 +348,8 @@ If the charset is `composition', return the actual one." (setq charsets (mm-delete-duplicates charsets)) (if (and (> (length charsets) 1) (fboundp 'find-coding-systems-region) - (memq 'utf-8 (find-coding-systems-region b e))) + (let ((cs (find-coding-systems-region b e))) + (or (memq 'utf-8 cs) (memq 'mule-utf-8 cs)))) '(utf-8) charsets))) @@ -468,7 +477,7 @@ Mule4 only." (nreverse out))) (defvar mm-inhibit-file-name-handlers - '(jka-compr-handler) + '(jka-compr-handler image-file-handler) "A list of handlers doing (un)compression (etc) thingies.") (defun mm-insert-file-contents (filename &optional visit beg end replace