summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2012-08-08 11:17:13 +0300
committerJuri Linkov <juri@jurta.org>2012-08-08 11:17:13 +0300
commit53fa865294bada6c2c441f195211671d427bcd69 (patch)
tree5df48bfb30f260a1fd14c7f25f3e341376697302 /lisp/files.el
parent242c0a95652b91de2d3b3acd2bc2b84a352ea5eb (diff)
downloademacs-53fa865294bada6c2c441f195211671d427bcd69.tar.gz
* lisp/files.el (basic-save-buffer): Use `buffer-name' as the default
of `read-file-name' when buffer is not visiting a file. Fixes: debbugs:12128
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index b54d3d1b60e..c5651135dc1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4488,7 +4488,8 @@ Before and after saving the buffer, this function runs
(or buffer-file-name
(let ((filename
(expand-file-name
- (read-file-name "File to save in: ") nil)))
+ (read-file-name "File to save in: "
+ nil (expand-file-name (buffer-name))))))
(if (file-exists-p filename)
(if (file-directory-p filename)
;; Signal an error if the user specified the name of an