Function: mml-dnd-attach-file

mml-dnd-attach-file is a byte-compiled function defined in mml.el.gz.

Signature

(mml-dnd-attach-file URIS ACTION)

Documentation

Attach a drag and drop URIS, a list of local file URIs.

Query whether to use the types, dispositions and descriptions default for each URL, subject to mml-dnd-attach-options.

Return the action private, communicating to the drop source that the file has been attached.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/mml.el.gz
(defun mml-dnd-attach-file (uris _action)
  "Attach a drag and drop URIS, a list of local file URIs.

Query whether to use the types, dispositions and descriptions
default for each URL, subject to `mml-dnd-attach-options'.

Return the action `private', communicating to the drop source
that the file has been attached."
  (let (file (mml-dnd-attach-options mml-dnd-attach-options))
    (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)))
    (dolist (uri uris)
      (setq file (dnd-get-local-file-name uri t))
      (when (and file (file-regular-p file))
        (let (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)))))
  'private)