gnus-art.el (gnus-article-browse-html-*): Work for broken Chinese articles
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 27 Nov 2013 01:25:30 +0000 (01:25 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 27 Nov 2013 01:25:30 +0000 (01:25 +0000)
lisp/ChangeLog
lisp/gnus-art.el

index ac8fc5b..e302b40 100644 (file)
@@ -1,3 +1,12 @@
+2013-11-27  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       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  <jan.tatarik@gmail.com>
 
        * gnus-icalendar.el (gnus-icalendar-additional-identities): New.
index bc164ca..fd9323f 100644 (file)
@@ -2795,6 +2795,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))
@@ -2802,11 +2805,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))))))))
 
@@ -2909,7 +2913,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)))
@@ -2917,7 +2921,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)