2008-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
* mm-util.el (mm-set-buffer-multibyte): New function.
+ * mm-decode.el (mm-copy-to-buffer): Use it.
* gnus-win.el (gnus-configure-frame, gnus-all-windows-visible-p):
Prefer fboundp to functionp so it works with macros as well.
(defun mm-copy-to-buffer ()
"Copy the contents of the current buffer to a fresh buffer."
(let ((obuf (current-buffer))
+ (mb (mm-multibyte-p))
beg)
(goto-char (point-min))
(search-forward-regexp "^\n" nil t)
(setq beg (point))
(with-current-buffer
- ;; Preserve the data's unibyteness (for url-insert-file-contents).
- (let ((default-enable-multibyte-characters (mm-multibyte-p)))
- (generate-new-buffer " *mm*"))
+ (generate-new-buffer " *mm*")
+ ;; Preserve the data's unibyteness (for url-insert-file-contents).
+ (mm-set-buffer-multibyte mb)
(insert-buffer-substring obuf beg)
(current-buffer))))