summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 871a4b0548b..9b56dfa9693 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1859,13 +1859,12 @@ the various files."
(setq buffer-read-only read-only)))
(setq buffer-file-read-only read-only))
- (when (and (not (eq (not (null rawfile))
- (not (null find-file-literally))))
- (not nonexistent)
- ;; It is confusing to ask whether to visit
- ;; non-literally if they have the file in
- ;; hexl-mode or image-mode.
- (not (memq major-mode '(hexl-mode image-mode))))
+ (unless (or (eq (null rawfile) (null find-file-literally))
+ nonexistent
+ ;; It is confusing to ask whether to visit
+ ;; non-literally if they have the file in
+ ;; hexl-mode or image-mode.
+ (memq major-mode '(hexl-mode image-mode)))
(if (buffer-modified-p)
(if (y-or-n-p
(format
@@ -3879,6 +3878,10 @@ Interactively, confirmation is required unless you supply a prefix argument."
(or buffer-file-name (buffer-name))))))
(and confirm
(file-exists-p filename)
+ ;; NS does its own confirm dialog.
+ (not (and (eq (framep-on-display) 'ns)
+ (listp last-nonmenu-event)
+ use-dialog-box))
(or (y-or-n-p (format "File `%s' exists; overwrite? " filename))
(error "Canceled")))
(set-visited-file-name filename (not confirm))))