comparison lisp/gnus/gnus-art.el @ 93726:3e95f26e3241

(gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte. (gnus-request-article-this-buffer): Make sure the proper decoding is used if gnus-original-article-buffer happens to be unibyte.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 05 Apr 2008 20:12:37 +0000
parents a789a1138b08
children f42ef85caf91
comparison
equal deleted inserted replaced
93725:2ca2b5f1a567 93726:3e95f26e3241
4783 (defun gnus-mime-replace-part (file) 4783 (defun gnus-mime-replace-part (file)
4784 "Replace MIME part under point with an external body." 4784 "Replace MIME part under point with an external body."
4785 ;; Useful if file has already been saved to disk 4785 ;; Useful if file has already been saved to disk
4786 (interactive 4786 (interactive
4787 (list 4787 (list
4788 (mm-with-multibyte 4788 (read-file-name "Replace MIME part with file: "
4789 (read-file-name "Replace MIME part with file: " 4789 (or mm-default-directory default-directory)
4790 (or mm-default-directory default-directory) 4790 nil nil)))
4791 nil nil))))
4792 (gnus-mime-save-part-and-strip file)) 4791 (gnus-mime-save-part-and-strip file))
4793 4792
4794 (defun gnus-mime-save-part-and-strip (&optional file) 4793 (defun gnus-mime-save-part-and-strip (&optional file)
4795 "Save the MIME part under point then replace it with an external body. 4794 "Save the MIME part under point then replace it with an external body.
4796 If FILE is given, use it for the external part." 4795 If FILE is given, use it for the external part."
6584 ((and (get-buffer gnus-original-article-buffer) 6583 ((and (get-buffer gnus-original-article-buffer)
6585 (numberp article) 6584 (numberp article)
6586 (with-current-buffer gnus-original-article-buffer 6585 (with-current-buffer gnus-original-article-buffer
6587 (and (equal (car gnus-original-article) group) 6586 (and (equal (car gnus-original-article) group)
6588 (eq (cdr gnus-original-article) article)))) 6587 (eq (cdr gnus-original-article) article))))
6589 (insert-buffer-substring gnus-original-article-buffer) 6588 ;; `insert-buffer-substring' would incorrectly use the
6589 ;; equivalent of string-make-multibyte which amount to decoding
6590 ;; with locale-coding-system, causing failure of
6591 ;; subsequent decoding.
6592 (insert (mm-string-to-multibyte
6593 (with-current-buffer gnus-original-article-buffer
6594 (buffer-substring (point-min) (point-max)))))
6590 'article) 6595 'article)
6591 ;; Check the backlog. 6596 ;; Check the backlog.
6592 ((and gnus-keep-backlog 6597 ((and gnus-keep-backlog
6593 (gnus-backlog-request-article group article (current-buffer))) 6598 (gnus-backlog-request-article group article (current-buffer)))
6594 'article) 6599 'article)