diff options
| author | Andreas Schwab | 2014-12-19 11:47:51 +0100 |
|---|---|---|
| committer | Andreas Schwab | 2014-12-19 12:18:19 +0100 |
| commit | a864bfb57c8445156dbe7e30b0348d9896c27b28 (patch) | |
| tree | 976bfdf6cb0b44edd4fe7e9bdb9d5470a7b8e28b | |
| parent | 811aceeaef8d436bdecbbb2f87bcdbefeb0cdfd0 (diff) | |
| download | emacs-a864bfb57c8445156dbe7e30b0348d9896c27b28.tar.gz emacs-a864bfb57c8445156dbe7e30b0348d9896c27b28.zip | |
Fix content decoding in gnus-read-ephemeral-bug-group
* gnus-group.el (gnus-read-ephemeral-bug-group): Bind
coding-system-for-read and coding-system-for-write only around
with-temp-file, and make buffer unibyte. Don't write temp file twice.
| -rw-r--r-- | lisp/gnus/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/gnus/gnus-group.el | 42 |
2 files changed, 27 insertions, 21 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 3b2a702a69e..f69d3503a92 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-12-19 Andreas Schwab <schwab@linux-m68k.org> | ||
| 2 | |||
| 3 | * gnus-group.el (gnus-read-ephemeral-bug-group): Bind | ||
| 4 | coding-system-for-read and coding-system-for-write only around | ||
| 5 | with-temp-file, and make buffer unibyte. Don't write temp file twice. | ||
| 6 | |||
| 1 | 2014-11-26 John Mastro <john.b.mastro@gmail.com> (tiny change) | 7 | 2014-11-26 John Mastro <john.b.mastro@gmail.com> (tiny change) |
| 2 | 8 | ||
| 3 | * auth-source.el (auth-source-macos-keychain-search-items): Return | 9 | * auth-source.el (auth-source-macos-keychain-search-items): Return |
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index d8260b40434..a7e3d30a22a 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el | |||
| @@ -2459,27 +2459,27 @@ the bug number, and browsing the URL must return mbox output." | |||
| 2459 | (setq ids (string-to-number ids))) | 2459 | (setq ids (string-to-number ids))) |
| 2460 | (unless (listp ids) | 2460 | (unless (listp ids) |
| 2461 | (setq ids (list ids))) | 2461 | (setq ids (list ids))) |
| 2462 | (let ((tmpfile (mm-make-temp-file "gnus-temp-group-")) | 2462 | (let ((tmpfile (mm-make-temp-file "gnus-temp-group-"))) |
| 2463 | (coding-system-for-write 'binary) | 2463 | (let ((coding-system-for-write 'binary) |
| 2464 | (coding-system-for-read 'binary)) | 2464 | (coding-system-for-read 'binary)) |
| 2465 | (with-temp-file tmpfile | 2465 | (with-temp-file tmpfile |
| 2466 | (dolist (id ids) | 2466 | (set-buffer-multibyte nil) |
| 2467 | (url-insert-file-contents (format mbox-url id))) | 2467 | (dolist (id ids) |
| 2468 | (goto-char (point-min)) | 2468 | (url-insert-file-contents (format mbox-url id))) |
| 2469 | ;; Add the debbugs address so that we can respond to reports easily. | 2469 | (goto-char (point-min)) |
| 2470 | (while (re-search-forward "^To: " nil t) | 2470 | ;; Add the debbugs address so that we can respond to reports easily. |
| 2471 | (end-of-line) | 2471 | (while (re-search-forward "^To: " nil t) |
| 2472 | (insert (format ", %s@%s" (car ids) | 2472 | (end-of-line) |
| 2473 | (gnus-replace-in-string | 2473 | (insert (format ", %s@%s" (car ids) |
| 2474 | (gnus-replace-in-string mbox-url "^http://" "") | 2474 | (gnus-replace-in-string |
| 2475 | "/.*$" "")))) | 2475 | (gnus-replace-in-string mbox-url "^http://" "") |
| 2476 | (write-region (point-min) (point-max) tmpfile) | 2476 | "/.*$" "")))))) |
| 2477 | (gnus-group-read-ephemeral-group | 2477 | (gnus-group-read-ephemeral-group |
| 2478 | (format "nndoc+ephemeral:bug#%s" | 2478 | (format "nndoc+ephemeral:bug#%s" |
| 2479 | (mapconcat 'number-to-string ids ",")) | 2479 | (mapconcat 'number-to-string ids ",")) |
| 2480 | `(nndoc ,tmpfile | 2480 | `(nndoc ,tmpfile |
| 2481 | (nndoc-article-type mbox)) | 2481 | (nndoc-article-type mbox)) |
| 2482 | nil window-conf)) | 2482 | nil window-conf) |
| 2483 | (delete-file tmpfile))) | 2483 | (delete-file tmpfile))) |
| 2484 | 2484 | ||
| 2485 | (defun gnus-read-ephemeral-debian-bug-group (number) | 2485 | (defun gnus-read-ephemeral-debian-bug-group (number) |