diff options
| author | Katsumi Yamaoka | 2012-08-28 09:40:11 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2012-08-28 09:40:11 +0000 |
| commit | cc319c03f148c2c004ba390d85e9a09f452d69c1 (patch) | |
| tree | f27319eb91ec11b766619a446400d774cfe51ec9 | |
| parent | d44688e450495fd3b723c0f2cbdcd047c59e7384 (diff) | |
| download | emacs-cc319c03f148c2c004ba390d85e9a09f452d69c1.tar.gz emacs-cc319c03f148c2c004ba390d85e9a09f452d69c1.zip | |
gnus-sum.el (gnus-summary-enter-digest-group): Work for encoding and charset
| -rw-r--r-- | lisp/gnus/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 24 |
2 files changed, 26 insertions, 4 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2a47b049c9b..4b56d351ac2 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-08-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-sum.el (gnus-summary-enter-digest-group): Decode content | ||
| 4 | transfer encoding first; bind gnus-newsgroup-charset to the charset | ||
| 5 | that the article specifies (Bug#12209). | ||
| 6 | |||
| 1 | 2012-08-22 Katsumi Yamaoka <yamaoka@jpl.org> | 7 | 2012-08-22 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 8 | ||
| 3 | * gnus-cus.el (gnus-group-customize): Decode values posting-style holds. | 9 | * gnus-cus.el (gnus-group-customize): Decode values posting-style holds. |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 06f17bcf646..b44b953bec6 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -9137,7 +9137,7 @@ To control what happens when you exit the group, see the | |||
| 9137 | (list (cons 'save-article-group ogroup)))) | 9137 | (list (cons 'save-article-group ogroup)))) |
| 9138 | (case-fold-search t) | 9138 | (case-fold-search t) |
| 9139 | (buf (current-buffer)) | 9139 | (buf (current-buffer)) |
| 9140 | dig to-address) | 9140 | dig to-address charset) |
| 9141 | (with-current-buffer gnus-original-article-buffer | 9141 | (with-current-buffer gnus-original-article-buffer |
| 9142 | ;; Have the digest group inherit the main mail address of | 9142 | ;; Have the digest group inherit the main mail address of |
| 9143 | ;; the parent article. | 9143 | ;; the parent article. |
| @@ -9150,16 +9150,32 @@ To control what happens when you exit the group, see the | |||
| 9150 | to-address)))))) | 9150 | to-address)))))) |
| 9151 | (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) | 9151 | (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) |
| 9152 | (insert-buffer-substring gnus-original-article-buffer) | 9152 | (insert-buffer-substring gnus-original-article-buffer) |
| 9153 | ;; Remove lines that may lead nndoc to misinterpret the | ||
| 9154 | ;; document type. | ||
| 9155 | (narrow-to-region | 9153 | (narrow-to-region |
| 9156 | (goto-char (point-min)) | 9154 | (goto-char (point-min)) |
| 9157 | (or (search-forward "\n\n" nil t) (point))) | 9155 | (or (search-forward "\n\n" nil t) (point))) |
| 9156 | ;; Remove lines that may lead nndoc to misinterpret the | ||
| 9157 | ;; document type. | ||
| 9158 | (goto-char (point-min)) | 9158 | (goto-char (point-min)) |
| 9159 | (delete-matching-lines "^Path:\\|^From ") | 9159 | (delete-matching-lines "^Path:\\|^From ") |
| 9160 | ;; Parse charset, and decode content transfer encoding. | ||
| 9161 | (setq charset (mail-content-type-get | ||
| 9162 | (mail-header-parse-content-type | ||
| 9163 | (or (gnus-fetch-field "content-type") "")) | ||
| 9164 | 'charset)) | ||
| 9165 | (let ((encoding (gnus-fetch-field "content-transfer-encoding"))) | ||
| 9166 | (when encoding | ||
| 9167 | (message-remove-header "content-transfer-encoding") | ||
| 9168 | (goto-char (point-max)) | ||
| 9169 | (widen) | ||
| 9170 | (narrow-to-region (point) (point-max)) | ||
| 9171 | (mm-decode-content-transfer-encoding | ||
| 9172 | (intern (downcase (mail-header-strip encoding)))))) | ||
| 9160 | (widen)) | 9173 | (widen)) |
| 9161 | (unwind-protect | 9174 | (unwind-protect |
| 9162 | (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset) | 9175 | (if (let ((gnus-newsgroup-ephemeral-charset |
| 9176 | (if charset | ||
| 9177 | (intern (downcase (gnus-strip-whitespace charset))) | ||
| 9178 | gnus-newsgroup-charset)) | ||
| 9163 | (gnus-newsgroup-ephemeral-ignored-charsets | 9179 | (gnus-newsgroup-ephemeral-ignored-charsets |
| 9164 | gnus-newsgroup-ignored-charsets)) | 9180 | gnus-newsgroup-ignored-charsets)) |
| 9165 | (gnus-group-read-ephemeral-group | 9181 | (gnus-group-read-ephemeral-group |