From: yamaoka Date: Thu, 22 Mar 2001 01:48:47 +0000 (+0000) Subject: * mm-decode.el (mm-copy-to-buffer): Copy buffer in unibyte mode. X-Git-Tag: t-gnus-6_15_0-10-quimby~5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d0a97b63384a429b570ee2198c24ed4d93905fc9;p=elisp%2Fgnus.git- * mm-decode.el (mm-copy-to-buffer): Copy buffer in unibyte mode. --- diff --git a/ChangeLog b/ChangeLog index ced0009..ee20333 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-03-21 Thierry Emery + + * lisp/mm-decode.el (mm-copy-to-buffer): Copy buffer in unibyte + mode. + 2001-03-19 Katsumi Yamaoka * lisp/gnus-kill.el (gnus-execute): Work with the extra headers. diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index bc2b7b5..d44a5dc 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -443,14 +443,18 @@ The original alist is not modified. See also `destructive-alist-to-plist'." (defun mm-copy-to-buffer () "Copy the contents of the current buffer to a fresh buffer." (save-excursion - (let ((obuf (current-buffer)) - beg) + (let ((flag enable-multibyte-characters) + (new-buffer (generate-new-buffer " *mm*"))) (goto-char (point-min)) (search-forward-regexp "^\n" nil t) - (setq beg (point)) - (set-buffer (generate-new-buffer " *mm*")) - (insert-buffer-substring obuf beg) - (current-buffer)))) + (save-restriction + (narrow-to-region (point) (point-max)) + (when flag + (set-buffer-multibyte nil)) + (copy-to-buffer new-buffer (point-min) (point-max)) + (when flag + (set-buffer-multibyte t))) + new-buffer))) (defun mm-display-parts (handle &optional no-default) (if (stringp (car handle))