Function: mml-attach-buffer
mml-attach-buffer is an interactive and byte-compiled function defined
in mml.el.gz.
Signature
(mml-attach-buffer BUFFER &optional TYPE DESCRIPTION DISPOSITION FILENAME)
Documentation
Attach a buffer to the outgoing MIME message.
BUFFER is the name of the buffer to attach. See
mml-attach-file regarding TYPE, DESCRIPTION and DISPOSITION.
FILENAME is a suggested file name for the attachment should a
recipient wish to save a copy separate from the message.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/mml.el.gz
(defun mml-attach-buffer (buffer &optional type description disposition filename)
"Attach a buffer to the outgoing MIME message.
BUFFER is the name of the buffer to attach. See
`mml-attach-file' regarding TYPE, DESCRIPTION and DISPOSITION.
FILENAME is a suggested file name for the attachment should a
recipient wish to save a copy separate from the message."
(interactive
(let* ((buffer (read-buffer "Attach buffer: "))
(type (mml-minibuffer-read-type buffer "text/plain"))
(description (mml-minibuffer-read-description))
(disposition (mml-minibuffer-read-disposition type nil)))
(list buffer type description disposition)))
;; If in the message header, attach at the end and leave point unchanged.
(let ((head (unless (message-in-body-p) (point))))
(if head (goto-char (point-max)))
(apply #'mml-insert-empty-tag
'part 'type type 'buffer buffer
'disposition disposition 'description description
(and filename `(filename ,filename)))
;; When using Mail mode, make sure it does the mime encoding
;; when you send the message.
(or (eq mail-user-agent 'message-user-agent)
(setq mail-encode-mml t))
(when head
(unless (pos-visible-in-window-p)
(message
"The buffer \"%s\" has been attached at the end of the message"
buffer))
(goto-char head))))