emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109800: gnus-sum.el (gnus-summary-en


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109800: gnus-sum.el (gnus-summary-enter-digest-group): Work for encoding and charset
Date: Tue, 28 Aug 2012 09:40:11 +0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109800
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2012-08-28 09:40:11 +0000
message:
  gnus-sum.el (gnus-summary-enter-digest-group): Work for encoding and charset
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-sum.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2012-08-22 10:37:55 +0000
+++ b/lisp/gnus/ChangeLog       2012-08-28 09:40:11 +0000
@@ -1,3 +1,9 @@
+2012-08-28  Katsumi Yamaoka  <address@hidden>
+
+       * gnus-sum.el (gnus-summary-enter-digest-group): Decode content
+       transfer encoding first; bind gnus-newsgroup-charset to the charset
+       that the article specifies (Bug#12209).
+
 2012-08-22  Katsumi Yamaoka  <address@hidden>
 
        * gnus-cus.el (gnus-group-customize): Decode values posting-style holds.

=== modified file 'lisp/gnus/gnus-sum.el'
--- a/lisp/gnus/gnus-sum.el     2012-07-24 22:17:17 +0000
+++ b/lisp/gnus/gnus-sum.el     2012-08-28 09:40:11 +0000
@@ -9137,7 +9137,7 @@
                           (list (cons 'save-article-group ogroup))))
           (case-fold-search t)
           (buf (current-buffer))
-          dig to-address)
+          dig to-address charset)
       (with-current-buffer gnus-original-article-buffer
        ;; Have the digest group inherit the main mail address of
        ;; the parent article.
@@ -9150,16 +9150,32 @@
                                      to-address))))))
        (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*"))
        (insert-buffer-substring gnus-original-article-buffer)
-       ;; Remove lines that may lead nndoc to misinterpret the
-       ;; document type.
        (narrow-to-region
         (goto-char (point-min))
         (or (search-forward "\n\n" nil t) (point)))
+       ;; Remove lines that may lead nndoc to misinterpret the
+       ;; document type.
        (goto-char (point-min))
        (delete-matching-lines "^Path:\\|^From ")
+       ;; Parse charset, and decode content transfer encoding.
+       (setq charset (mail-content-type-get
+                      (mail-header-parse-content-type
+                       (or (gnus-fetch-field "content-type") ""))
+                      'charset))
+       (let ((encoding (gnus-fetch-field "content-transfer-encoding")))
+         (when encoding
+           (message-remove-header "content-transfer-encoding")
+           (goto-char (point-max))
+           (widen)
+           (narrow-to-region (point) (point-max))
+           (mm-decode-content-transfer-encoding
+            (intern (downcase (mail-header-strip encoding))))))
        (widen))
       (unwind-protect
-         (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset)
+         (if (let ((gnus-newsgroup-ephemeral-charset
+                    (if charset
+                        (intern (downcase (gnus-strip-whitespace charset)))
+                      gnus-newsgroup-charset))
                    (gnus-newsgroup-ephemeral-ignored-charsets
                     gnus-newsgroup-ignored-charsets))
                (gnus-group-read-ephemeral-group


reply via email to

[Prev in Thread] Current Thread [Next in Thread]