emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/files.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el,v
Date: Tue, 18 Nov 2008 18:26:16 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/11/18 18:26:14

Index: lisp/files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.1012
retrieving revision 1.1013
diff -u -b -r1.1012 -r1.1013
--- lisp/files.el       14 Nov 2008 23:36:37 -0000      1.1012
+++ lisp/files.el       18 Nov 2008 18:26:13 -0000      1.1013
@@ -1102,6 +1102,13 @@
     (rename-file encoded new-encoded ok-if-already-exists)
     newname))
 
+(defcustom confirm-nonexistent-file-or-buffer t
+  "If non-nil, confirmation is requested before visiting a new file or buffer.
+This affects commands like `switch-to-buffer' and `find-file'."
+  :group 'find-file
+  :version "23.1"
+  :type 'boolean)
+
 (defun read-buffer-to-switch (prompt)
   "Read the name of a buffer to switch to and return as a string.
 It is intended for `switch-to-buffer' family of commands since they
@@ -1110,7 +1117,8 @@
   (let ((rbts-completion-table (internal-complete-buffer-except)))
     (minibuffer-with-setup-hook
         (lambda () (setq minibuffer-completion-table rbts-completion-table))
-      (read-buffer prompt (other-buffer (current-buffer))))))
+      (read-buffer prompt (other-buffer (current-buffer))
+                   (if confirm-nonexistent-file-or-buffer 'confirm-only)))))
 
 (defun switch-to-buffer-other-window (buffer &optional norecord)
   "Select buffer BUFFER in another window.
@@ -1192,12 +1200,6 @@
             ,@body)
         (remove-hook 'minibuffer-setup-hook ,hook)))))
 
-(defcustom find-file-confirm-nonexistent-file nil
-  "If non-nil, `find-file' requires confirmation before visiting a new file."
-  :group 'find-file
-  :version "23.1"
-  :type 'boolean)
-
 (defun find-file-read-args (prompt mustmatch)
   (list (let ((find-file-default
               (and buffer-file-name
@@ -1230,7 +1232,7 @@
 automatically choosing a major mode, use \\[find-file-literally]."
   (interactive
    (find-file-read-args "Find file: "
-                        (if find-file-confirm-nonexistent-file 'confirm-only)))
+                        (if confirm-nonexistent-file-or-buffer 'confirm-only)))
   (let ((value (find-file-noselect filename nil nil wildcards)))
     (if (listp value)
        (mapcar 'switch-to-buffer (nreverse value))
@@ -1250,7 +1252,7 @@
 expand wildcards (if any) and visit multiple files."
   (interactive
    (find-file-read-args "Find file in other window: "
-                        (if find-file-confirm-nonexistent-file 'confirm-only)))
+                        (if confirm-nonexistent-file-or-buffer 'confirm-only)))
   (let ((value (find-file-noselect filename nil nil wildcards)))
     (if (listp value)
        (progn
@@ -1273,7 +1275,7 @@
 expand wildcards (if any) and visit multiple files."
   (interactive
    (find-file-read-args "Find file in other frame: "
-                        (if find-file-confirm-nonexistent-file 'confirm-only)))
+                        (if confirm-nonexistent-file-or-buffer 'confirm-only)))
   (let ((value (find-file-noselect filename nil nil wildcards)))
     (if (listp value)
        (progn
@@ -1298,7 +1300,7 @@
 Use \\[toggle-read-only] to permit editing."
   (interactive
    (find-file-read-args "Find file read-only: "
-                        (if find-file-confirm-nonexistent-file 'confirm-only)))
+                        (if confirm-nonexistent-file-or-buffer 'confirm-only)))
   (unless (or (and wildcards find-file-wildcards
                   (not (string-match "\\`/:" filename))
                   (string-match "[[*?]" filename))
@@ -1315,7 +1317,7 @@
 Use \\[toggle-read-only] to permit editing."
   (interactive
    (find-file-read-args "Find file read-only other window: "
-                        (if find-file-confirm-nonexistent-file 'confirm-only)))
+                        (if confirm-nonexistent-file-or-buffer 'confirm-only)))
   (unless (or (and wildcards find-file-wildcards
                   (not (string-match "\\`/:" filename))
                   (string-match "[[*?]" filename))
@@ -1332,7 +1334,7 @@
 Use \\[toggle-read-only] to permit editing."
   (interactive
    (find-file-read-args "Find file read-only other frame: "
-                        (if find-file-confirm-nonexistent-file 'confirm-only)))
+                        (if confirm-nonexistent-file-or-buffer 'confirm-only)))
   (unless (or (and wildcards find-file-wildcards
                   (not (string-match "\\`/:" filename))
                   (string-match "[[*?]" filename))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]