aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2017-01-26 19:07:00 +0100
committerLars Ingebrigtsen2017-01-26 19:46:27 +0100
commit9fc67ae2dd49ab574d4858496c33fdd6c00f9c9b (patch)
tree3130398bd610aaf2fac649b18e89b5862f1125be
parentcf60608803b88321a43b7ff110d9caec09c270e7 (diff)
downloademacs-9fc67ae2dd49ab574d4858496c33fdd6c00f9c9b.tar.gz
emacs-9fc67ae2dd49ab574d4858496c33fdd6c00f9c9b.zip
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).
-rw-r--r--lisp/gnus/mml.el4
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."
1251 (let* ((completion-ignored-extensions nil) 1251 (let* ((completion-ignored-extensions nil)
1252 (file (read-file-name prompt 1252 (file (read-file-name prompt
1253 (or mml-default-directory default-directory) 1253 (or mml-default-directory default-directory)
1254 nil t))) 1254 "" t)))
1255 ;; Prevent some common errors. This is inspired by similar code in 1255 ;; Prevent some common errors. This is inspired by similar code in
1256 ;; VM. 1256 ;; VM.
1257 (when (zerop (length file))
1258 (error "No file name entered"))
1257 (when (file-directory-p file) 1259 (when (file-directory-p file)
1258 (error "%s is a directory, cannot attach" file)) 1260 (error "%s is a directory, cannot attach" file))
1259 (unless (file-exists-p file) 1261 (unless (file-exists-p file)