Function: mml-attach-external
mml-attach-external is an interactive and byte-compiled function
defined in mml.el.gz.
Signature
(mml-attach-external FILE &optional TYPE DESCRIPTION)
Documentation
Attach an external file into the buffer.
FILE is an ange-ftp specification of the part location. TYPE is the MIME type to use.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/mml.el.gz
(defun mml-attach-external (file &optional type description)
"Attach an external file into the buffer.
FILE is an ange-ftp specification of the part location.
TYPE is the MIME type to use."
(interactive
(let* ((file (mml-minibuffer-read-file "Attach external file: "))
(type (mml-minibuffer-read-type file))
(description (mml-minibuffer-read-description)))
(list file type description)))
;; 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 'external 'type type 'name file
'disposition "attachment" '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 file \"%s\" has been attached at the end of the message"
(file-name-nondirectory file)))
(goto-char head))))