From 9527d201c1c5a323eb605e260f057b163722712e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 26 Jan 2017 18:19:46 +0100 Subject: [PATCH] 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). --- lisp/gnus/mml.el | 19 +++++++++++++++---- 1 file 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)))) -- 2.11.4.GIT