diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2017-01-26 19:07:00 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2017-01-26 19:46:27 +0100 |
commit | 9fc67ae2dd49ab574d4858496c33fdd6c00f9c9b (patch) | |
tree | 3130398bd610aaf2fac649b18e89b5862f1125be /lisp/gnus | |
parent | cf60608803b88321a43b7ff110d9caec09c270e7 (diff) | |
download | emacs-9fc67ae2dd49ab574d4858496c33fdd6c00f9c9b.tar.gz |
Give a slight better error message in mml-minibuffer-read-file
* lisp/gnus/mml.el (mml-minibuffer-read-file): Give a slightly
better error message when the user enters nothing (bug#20480).
Diffstat (limited to 'lisp/gnus')
-rw-r--r-- | lisp/gnus/mml.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index df541fbcccd..19c19decedd 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -1251,9 +1251,11 @@ If not set, `default-directory' will be used." (let* ((completion-ignored-extensions nil) (file (read-file-name prompt (or mml-default-directory default-directory) - nil t))) + "" t))) ;; Prevent some common errors. This is inspired by similar code in ;; VM. + (when (zerop (length file)) + (error "No file name entered")) (when (file-directory-p file) (error "%s is a directory, cannot attach" file)) (unless (file-exists-p file) |