summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 2de1dd5dee9..3dce4be9354 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1438,7 +1438,7 @@ Remember to delete the initial contents of the minibuffer
if you wish to pass an empty string as the argument.
The optional second argument NO-QUERY, if non-nil, inhibits asking for
-confirmation in the case where the file FILENAME already exists."
+confirmation in the case where another buffer is already visiting FILENAME."
(interactive "FSet visited file name: ")
(if (buffer-base-buffer)
(error "An indirect buffer cannot visit a file"))
@@ -1553,7 +1553,7 @@ Interactively, confirmation is required unless you supply a prefix argument."
(file-exists-p filename)
(or (y-or-n-p (format "File `%s' exists; overwrite? " filename))
(error "Canceled")))
- (set-visited-file-name filename)))
+ (set-visited-file-name filename (not confirm))))
(set-buffer-modified-p t)
(save-buffer))