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)

Documentation

Attach a buffer to the outgoing MIME message.

BUFFER is the name of the buffer to attach. See mml-attach-file for details of operation.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/mml.el.gz
(defun mml-attach-buffer (buffer &optional type description disposition)
  "Attach a buffer to the outgoing MIME message.
BUFFER is the name of the buffer to attach.  See
`mml-attach-file' for details of operation."
  (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)))
    (mml-insert-empty-tag 'part 'type type 'buffer buffer
			  'disposition disposition
			  'description description)
    ;; 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))))