diff options
| author | Lars Ingebrigtsen <larsi@gnus.org> | 2017-01-26 18:19:46 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen <larsi@gnus.org> | 2017-01-26 18:19:46 +0100 |
| commit | 9527d201c1c5a323eb605e260f057b163722712e (patch) | |
| tree | 3d2d13bb8843393509b19fe8231f6296687e8735 /lisp/gnus/mml.el | |
| parent | eff6c6ac8503d44cf1d4cb2406fc57148b6a1844 (diff) | |
| download | emacs-9527d201c1c5a323eb605e260f057b163722712e.tar.gz | |
Allow mml-attach-file to prompt less
* lisp/gnus/mml.el (mml-attach-file): If given a prefix, don't
prompt for type/description/disposition, but use defaults
(bug#19202).
Diffstat (limited to 'lisp/gnus/mml.el')
| -rw-r--r-- | lisp/gnus/mml.el | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 6d9e24e708e..df541fbcccd 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -1383,12 +1383,23 @@ content-type, a string of the form \"type/subtype\". DESCRIPTION is a one-line description of the attachment. The DISPOSITION specifies how the attachment is intended to be displayed. It can be either \"inline\" (displayed automatically within the message -body) or \"attachment\" (separate from the body)." +body) or \"attachment\" (separate from the body). + +If given a prefix interactively, no prompting will be done for +the TYPE, DESCRIPTION or DISPOSITION values. Instead defaults +will be computed and used." (interactive (let* ((file (mml-minibuffer-read-file "Attach file: ")) - (type (mml-minibuffer-read-type file)) - (description (mml-minibuffer-read-description)) - (disposition (mml-minibuffer-read-disposition type nil file))) + (type (if current-prefix-arg + (or (mm-default-file-encoding file) + "application/octet-stream") + (mml-minibuffer-read-type file))) + (description (if current-prefix-arg + nil + (mml-minibuffer-read-description))) + (disposition (if current-prefix-arg + (mml-content-disposition type file) + (mml-minibuffer-read-disposition type nil file)))) (list file type description disposition))) ;; If in the message header, attach at the end and leave point unchanged. (let ((head (unless (message-in-body-p) (point)))) |
