aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-02-01 01:31:37 +0000
committerKarl Heuer1994-02-01 01:31:37 +0000
commit4fbf62eea8852339a86347cc94e1dc31d643a478 (patch)
treef9db1368446c1e322ef632c971c16ec169431f02
parent2d8e81a591552ec3b66b35f08b29f9d3f1d1866c (diff)
downloademacs-4fbf62eea8852339a86347cc94e1dc31d643a478.tar.gz
emacs-4fbf62eea8852339a86347cc94e1dc31d643a478.zip
(revert-buffer): reposition after-revert-hook, and add before-revert-hook.
-rw-r--r--lisp/files.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el
index ad797857e6e..b04446e0561 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1726,7 +1726,8 @@ all.
1726If the value of `revert-buffer-function' is non-nil, it is called to 1726If the value of `revert-buffer-function' is non-nil, it is called to
1727do the work. 1727do the work.
1728 1728
1729The normal hook `after-revert-hook' is run at the end of `revert-buffer'." 1729The default revert function runs the hook `before-revert-hook' at the
1730beginning and `after-revert-hook' at the end."
1730 ;; I admit it's odd to reverse the sense of the prefix argument, but 1731 ;; I admit it's odd to reverse the sense of the prefix argument, but
1731 ;; there is a lot of code out there which assumes that the first 1732 ;; there is a lot of code out there which assumes that the first
1732 ;; argument should be t to avoid consulting the auto-save file, and 1733 ;; argument should be t to avoid consulting the auto-save file, and
@@ -1751,6 +1752,7 @@ The normal hook `after-revert-hook' is run at the end of `revert-buffer'."
1751 ((or noconfirm 1752 ((or noconfirm
1752 (yes-or-no-p (format "Revert buffer from file %s? " 1753 (yes-or-no-p (format "Revert buffer from file %s? "
1753 file-name))) 1754 file-name)))
1755 (run-hooks 'before-revert-hook)
1754 ;; If file was backed up but has changed since, 1756 ;; If file was backed up but has changed since,
1755 ;; we shd make another backup. 1757 ;; we shd make another backup.
1756 (and (not auto-save-p) 1758 (and (not auto-save-p)
@@ -1776,8 +1778,8 @@ The normal hook `after-revert-hook' is run at the end of `revert-buffer'."
1776 (insert-file-contents file-name (not auto-save-p)))) 1778 (insert-file-contents file-name (not auto-save-p))))
1777 (goto-char (min opoint (point-max))) 1779 (goto-char (min opoint (point-max)))
1778 (after-find-file nil nil t) 1780 (after-find-file nil nil t)
1779 t)))) 1781 (run-hooks 'after-revert-hook)
1780 (run-hooks 'after-revert-hook)) 1782 t)))))
1781 1783
1782(defun recover-file (file) 1784(defun recover-file (file)
1783 "Visit file FILE, but get contents from its last auto-save file." 1785 "Visit file FILE, but get contents from its last auto-save file."