summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/files.el b/lisp/files.el
index e6629d2a21a..71951dd349e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4527,13 +4527,12 @@ Interactively, confirmation is required unless you supply a prefix argument."
;; (interactive "FWrite file: ")
(interactive
(list (if buffer-file-name
- (read-file-name "Write file: "
- nil nil nil nil)
- (read-file-name "Write file: " default-directory
- (expand-file-name
- (file-name-nondirectory (buffer-name))
- default-directory)
- nil nil))
+ (read-file-name "Write file: ")
+ (read-file-name
+ (format-prompt "Write file" (file-name-nondirectory (buffer-name)))
+ default-directory
+ (expand-file-name (file-name-nondirectory (buffer-name))
+ default-directory)))
(not current-prefix-arg)))
(or (null filename) (string-equal filename "")
(progn
@@ -5271,10 +5270,13 @@ Before and after saving the buffer, this function runs
(unless (run-hook-with-args-until-success 'write-contents-functions)
;; If buffer has no file name, ask user for one.
(or buffer-file-name
- (let ((filename
- (expand-file-name
- (read-file-name "File to save in: "
- nil (expand-file-name (buffer-name))))))
+ (let* ((default (expand-file-name (buffer-name)))
+ (filename
+ (expand-file-name
+ (read-file-name
+ (format-prompt "File to save in"
+ (file-name-nondirectory default))
+ nil default))))
(if (file-exists-p filename)
(if (file-directory-p filename)
;; Signal an error if the user specified the name of an