summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2017-08-31 00:45:54 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2017-08-31 00:45:54 +0000
commita4f6b1097fb5d3f27d42b722b7f31fb35fe9da53 (patch)
tree1b53aeb016369fbc6ee9dc3593d4bdf25deba22f
parentcda26e64621d71c6a797f694418d844a621998be (diff)
downloademacs-a4f6b1097fb5d3f27d42b722b7f31fb35fe9da53.tar.gz
Respect directory a user enters (bug#28299)
* lisp/gnus/mm-decode.el (mm-save-part): Respect directory a user enters (bug#28299).
-rw-r--r--lisp/gnus/mm-decode.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index c6a0be36c40..9b77dadddb1 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1363,7 +1363,7 @@ PROMPT overrides the default one used to ask user for a file name."
(mm-handle-disposition handle) 'filename)
(mail-content-type-get
(mm-handle-type handle) 'name)))
- file)
+ file directory)
(when filename
(setq filename (gnus-map-function mm-file-name-rewrite-functions
(file-name-nondirectory filename))))
@@ -1372,16 +1372,20 @@ PROMPT overrides the default one used to ask user for a file name."
(setq file
(read-file-name
(or prompt
- (format "Save MIME part to (default %s): "
- (or filename "")))
- (or mm-default-directory default-directory)
- (expand-file-name (or filename "")
- (or mm-default-directory default-directory))))
+ (format "Save MIME part to%s: "
+ (if filename
+ (format " (default %s)" filename)
+ "")))
+ (or directory mm-default-directory default-directory)
+ (expand-file-name
+ (or filename "")
+ (or directory mm-default-directory default-directory))))
(cond ((or (not file) (equal file ""))
(message "Please enter a file name")
t)
((and (file-directory-p file)
(not filename))
+ (setq directory file)
(message "Please enter a non-directory file name")
t)
(t nil)))