aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2014-12-19 11:47:51 +0100
committerAndreas Schwab2015-01-08 00:19:21 +0100
commitad97127d9cd627f9c217738de81d88720a5c4c3a (patch)
tree9c8cef562d8b428f3633ade0e0c1786cc6f4537f
parent8596361bb3a005394db8328d8f0a6df0cb91b5cc (diff)
downloademacs-ad97127d9cd627f9c217738de81d88720a5c4c3a.tar.gz
emacs-ad97127d9cd627f9c217738de81d88720a5c4c3a.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/ChangeLog6
-rw-r--r--lisp/gnus/gnus-group.el42
2 files changed, 27 insertions, 21 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 73a0de76a1f..93117d31c99 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -10,6 +10,12 @@
10 * mm-decode.el (mm-shr): Bind `shr-width' to `fill-column' so that 10 * mm-decode.el (mm-shr): Bind `shr-width' to `fill-column' so that
11 lines don't get overlong when responding. 11 lines don't get overlong when responding.
12 12
132014-12-19 Andreas Schwab <schwab@linux-m68k.org>
14
15 * gnus-group.el (gnus-read-ephemeral-bug-group): Bind
16 coding-system-for-read and coding-system-for-write only around
17 with-temp-file, and make buffer unibyte. Don't write temp file twice.
18
132014-12-18 Paul Eggert <eggert@cs.ucla.edu> 192014-12-18 Paul Eggert <eggert@cs.ucla.edu>
14 20
15 * registry.el (registry-db): Set default slot later. 21 * registry.el (registry-db): Set default slot later.
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 29c380f8234..8dd1d78dd0b 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -2455,27 +2455,27 @@ the bug number, and browsing the URL must return mbox output."
2455 (setq ids (string-to-number ids))) 2455 (setq ids (string-to-number ids)))
2456 (unless (listp ids) 2456 (unless (listp ids)
2457 (setq ids (list ids))) 2457 (setq ids (list ids)))
2458 (let ((tmpfile (mm-make-temp-file "gnus-temp-group-")) 2458 (let ((tmpfile (mm-make-temp-file "gnus-temp-group-")))
2459 (coding-system-for-write 'binary) 2459 (let ((coding-system-for-write 'binary)
2460 (coding-system-for-read 'binary)) 2460 (coding-system-for-read 'binary))
2461 (with-temp-file tmpfile 2461 (with-temp-file tmpfile
2462 (dolist (id ids) 2462 (set-buffer-multibyte nil)
2463 (url-insert-file-contents (format mbox-url id))) 2463 (dolist (id ids)
2464 (goto-char (point-min)) 2464 (url-insert-file-contents (format mbox-url id)))
2465 ;; Add the debbugs address so that we can respond to reports easily. 2465 (goto-char (point-min))
2466 (while (re-search-forward "^To: " nil t) 2466 ;; Add the debbugs address so that we can respond to reports easily.
2467 (end-of-line) 2467 (while (re-search-forward "^To: " nil t)
2468 (insert (format ", %s@%s" (car ids) 2468 (end-of-line)
2469 (gnus-replace-in-string 2469 (insert (format ", %s@%s" (car ids)
2470 (gnus-replace-in-string mbox-url "^http://" "") 2470 (gnus-replace-in-string
2471 "/.*$" "")))) 2471 (gnus-replace-in-string mbox-url "^http://" "")
2472 (write-region (point-min) (point-max) tmpfile) 2472 "/.*$" ""))))))
2473 (gnus-group-read-ephemeral-group 2473 (gnus-group-read-ephemeral-group
2474 (format "nndoc+ephemeral:bug#%s" 2474 (format "nndoc+ephemeral:bug#%s"
2475 (mapconcat 'number-to-string ids ",")) 2475 (mapconcat 'number-to-string ids ","))
2476 `(nndoc ,tmpfile 2476 `(nndoc ,tmpfile
2477 (nndoc-article-type mbox)) 2477 (nndoc-article-type mbox))
2478 nil window-conf)) 2478 nil window-conf)
2479 (delete-file tmpfile))) 2479 (delete-file tmpfile)))
2480 2480
2481(defun gnus-read-ephemeral-debian-bug-group (number) 2481(defun gnus-read-ephemeral-debian-bug-group (number)