[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 9527d20 1/2: Allow mml-attach-file to prompt less
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 9527d20 1/2: Allow mml-attach-file to prompt less |
Date: |
Thu, 26 Jan 2017 17:33:00 +0000 (UTC) |
branch: master
commit 9527d201c1c5a323eb605e260f057b163722712e
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
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 6d9e24e..df541fb 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))))