From: Katsumi Yamaoka Date: Wed, 27 Nov 2013 01:54:35 +0000 (+0000) Subject: lisp/gnus/gnus-art.el (gnus-article-browse-html-*): Work for broken Chinese articles X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~683 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0b575a333b489055df39de80a9ef6c617002820b;p=emacs.git lisp/gnus/gnus-art.el (gnus-article-browse-html-*): Work for broken Chinese articles --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 48cbb2fa499..1e332154118 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,12 @@ +2013-11-27 Katsumi Yamaoka + + Work for broken Chinese articles. + + * gnus-art.el (gnus-article-browse-html-save-cid-content): + Exclude broken handles that gnus-summary-enter-digest-group may create. + (gnus-article-browse-html-parts): + Allow overriding charset by mm-charset-override-alist. + 2013-11-21 Jan Tatarik * gnus-icalendar.el (gnus-icalendar-additional-identities): New. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index b80aa3a24e9..b939fa64523 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2794,6 +2794,9 @@ Return file name." (dolist (handle handles) (cond ((not (listp handle))) + ;; Exclude broken handles that `gnus-summary-enter-digest-group' + ;; may create. + ((not (or (bufferp (car handle)) (stringp (car handle))))) ((equal (mm-handle-media-supertype handle) "multipart") (when (setq file (gnus-article-browse-html-save-cid-content cid handle directory)) @@ -2801,11 +2804,12 @@ Return file name." ((equal (concat "<" cid ">") (mm-handle-id handle)) (setq file (expand-file-name - (or (mm-handle-filename handle) - (concat - (make-temp-name "cid") - (car (rassoc (car (mm-handle-type handle)) mailcap-mime-extensions)))) - directory)) + (or (mm-handle-filename handle) + (concat + (make-temp-name "cid") + (car (rassoc (car (mm-handle-type handle)) + mailcap-mime-extensions)))) + directory)) (mm-save-part-to-file handle file) (throw 'found file)))))))) @@ -2908,7 +2912,7 @@ message header will be added to the bodies of the \"text/html\" parts." (cond ((= (length hcharset) 1) (setq hcharset (car hcharset) coding (mm-charset-to-coding-system - hcharset))) + hcharset nil t))) ((> (length hcharset) 1) (setq hcharset 'utf-8 coding hcharset))) @@ -2916,7 +2920,8 @@ message header will be added to the bodies of the \"text/html\" parts." (if charset (progn (setq body - (mm-charset-to-coding-system charset)) + (mm-charset-to-coding-system charset + nil t)) (if (eq coding body) (setq eheader (mm-encode-coding-string (buffer-string) coding)