Function: mm-copy-to-buffer
mm-copy-to-buffer is a byte-compiled function defined in
mm-decode.el.gz.
Signature
(mm-copy-to-buffer)
Documentation
Copy the contents of the current buffer to a fresh unibyte buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/mm-decode.el.gz
(defun mm-copy-to-buffer ()
"Copy the contents of the current buffer to a fresh unibyte buffer."
(let ((obuf (current-buffer))
(mb enable-multibyte-characters)
(nbuf (generate-new-buffer " *mm*"))
beg)
(goto-char (point-min))
(search-forward-regexp "^\n" nil 'move) ;; There might be no body.
(setq beg (point))
(with-current-buffer nbuf
(set-buffer-multibyte nil))
(if (null mb)
(with-current-buffer nbuf
(insert-buffer-substring obuf beg)
(current-buffer))
(encode-coding-region beg (point-max) 'utf-8-emacs-unix nbuf)
(with-current-buffer nbuf
(goto-char (point-max))
(current-buffer)))))