1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-24 19:03:29 +00:00

* 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.
This commit is contained in:
Jim Blandy 1993-02-22 14:17:16 +00:00
parent 6f5191a247
commit 1ab31687d4
2 changed files with 22 additions and 8 deletions

View File

@ -1427,21 +1427,35 @@ or multiple mail buffers, etc."
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

View File

@ -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 @@ the option to steal the lock."
(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)