changeset 1905:494dd05d460c

* files.el (revert-buffer): Reverse the sense of the first argument, but leave interactive usage the same. * vc.el (vc-resynch-window): Call vc-revert-buffer1 with the newly appropriate arguments. This seems to be the only file which was adjusted for the new meaning of the revert-buffer arguments.
author Jim Blandy <jimb@redhat.com>
date Mon, 22 Feb 1993 14:17:16 +0000
parents cca15d76f3e5
children 158faf65239b
files lisp/files.el lisp/vc.el
diffstat 2 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Mon Feb 22 14:16:48 1993 +0000
+++ b/lisp/files.el	Mon Feb 22 14:17:16 1993 +0000
@@ -1427,21 +1427,35 @@
 Gets two args, first the nominal file name to use,
 and second, t if reading the auto-save file.")
 
-(defun revert-buffer (&optional check-auto noconfirm)
+(defun revert-buffer (&optional ignore-auto noconfirm)
   "Replace the buffer text with the text of the visited file on disk.
 This undoes all changes since the file was visited or saved.
 With a prefix argument, offer to revert from latest auto-save file, if
 that is more recent than the visited file.
-When called from lisp, this is the first argument, CHECK-AUTO; it is optional.
-Optional second argument NOCONFIRM means don't ask for confirmation at all.
+
+When called from lisp, the first argument is IGNORE-AUTO; only offer
+to revert from the auto-save file when this is nil.  Note that the
+sense of this argument is the reverse of the prefix argument, for the
+sake of backward compatibility.  IGNORE-AUTO is optional, defaulting
+to nil.
+
+Optional second argument NOCONFIRM means don't ask for confirmation at
+all.
 
 If the value of `revert-buffer-function' is non-nil, it is called to
 do the work."
-  (interactive "P")
+  ;; I admit it's odd to reverse the sense of the prefix argument, but
+  ;; there is a lot of code out there which assumes that the first
+  ;; argument should be t to avoid consulting the auto-save file, and
+  ;; there's no straightforward way to encourage authors to notice a
+  ;; reversal of the argument sense.  So I'm just changing the user
+  ;; interface, but leaving the programmatic interface the same.
+  (interactive (list (not prefix-arg)))
   (if revert-buffer-function
-      (funcall revert-buffer-function (not check-auto) noconfirm)
+      (funcall revert-buffer-function ignore-auto noconfirm)
     (let* ((opoint (point))
-	   (auto-save-p (and check-auto (recent-auto-save-p)
+	   (auto-save-p (and (not ignore-auto)
+			     (recent-auto-save-p)
 			     buffer-auto-save-file-name
 			     (file-readable-p buffer-auto-save-file-name)
 			     (y-or-n-p
--- a/lisp/vc.el	Mon Feb 22 14:16:48 1993 +0000
+++ b/lisp/vc.el	Mon Feb 22 14:17:16 1993 +0000
@@ -5,7 +5,7 @@
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Version: 4.0
 
-;;	$Id: vc.el,v 1.18 1992/11/20 19:33:38 rms Exp jimb $	
+;;	$Id: vc.el,v 1.19 1992/12/12 15:22:26 jimb Exp jimb $	
 
 ;; This file is part of GNU Emacs.
 
@@ -359,7 +359,7 @@
   (and (string= buffer-file-name file)
        (if keep
 	   (progn
-	     (vc-revert-buffer1 nil noquery)
+	     (vc-revert-buffer1 t noquery)
 	     (vc-mode-line buffer-file-name))
 	 (progn
 	   (delete-window)