Function: mml-dnd-attach-file
mml-dnd-attach-file is a byte-compiled function defined in mml.el.gz.
Signature
(mml-dnd-attach-file URI ACTION)
Documentation
Attach a drag and drop file.
Ask for type, description or disposition according to
mml-dnd-attach-options.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/mml.el.gz
(defun mml-dnd-attach-file (uri _action)
"Attach a drag and drop file.
Ask for type, description or disposition according to
`mml-dnd-attach-options'."
(let ((file (dnd-get-local-file-name uri t)))
(when (and file (file-regular-p file))
(let ((mml-dnd-attach-options mml-dnd-attach-options)
type description disposition)
(setq mml-dnd-attach-options
(when (and (eq mml-dnd-attach-options t)
(not
(y-or-n-p
"Use default type, disposition and description? ")))
'(type description disposition)))
(when (or (memq 'type mml-dnd-attach-options)
(memq 'disposition mml-dnd-attach-options))
(setq type (mml-minibuffer-read-type file)))
(when (memq 'description mml-dnd-attach-options)
(setq description (mml-minibuffer-read-description)))
(when (memq 'disposition mml-dnd-attach-options)
(setq disposition (mml-minibuffer-read-disposition type nil file)))
(mml-attach-file file type description disposition)))))