Fix the previous mml patch better

* lisp/gnus/mml.el (mml-minibuffer-read-file): Fix the
previous patch in a better way (bug#20480).
This commit is contained in:
Lars Ingebrigtsen 2017-01-26 19:09:58 +01:00
parent 9fc67ae2dd
commit d47dadd168

View file

@ -1249,13 +1249,12 @@ If not set, `default-directory' will be used."
(defun mml-minibuffer-read-file (prompt)
(let* ((completion-ignored-extensions nil)
(buffer-file-name nil)
(file (read-file-name prompt
(or mml-default-directory default-directory)
"" t)))
nil 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)