summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-07-05 22:49:45 +0000
committerRichard M. Stallman <rms@gnu.org>1999-07-05 22:49:45 +0000
commit2df32500abcc5219a66119d2a6b32cebf97e7722 (patch)
tree78b316bac881d8287148d7a80631dc7cbf8d33cb
parent8f3c1d763f2d433eae357a60d210910d0ed7e252 (diff)
downloademacs-2df32500abcc5219a66119d2a6b32cebf97e7722.tar.gz
(revert-buffer): Don't preserve point here.
(revert-buffer-insert-file-contents-function): Doc fix.
-rw-r--r--lisp/files.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/files.el b/lisp/files.el
index ed5d1ff6804..2ce87f20866 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2657,7 +2657,9 @@ which are the arguments that `revert-buffer' received.")
(defvar revert-buffer-insert-file-contents-function nil
"Function to use to insert contents when reverting this buffer.
Gets two args, first the nominal file name to use,
-and second, t if reading the auto-save file.")
+and second, t if reading the auto-save file.
+
+The function you specify is responsible for updating (or preserving) point.")
(defvar before-revert-hook nil
"Normal hook for `revert-buffer' to run before reverting.
@@ -2714,8 +2716,7 @@ non-nil, it is called instead of rereading visited file contents."
(interactive (list (not current-prefix-arg)))
(if revert-buffer-function
(funcall revert-buffer-function ignore-auto noconfirm)
- (let* ((opoint (point))
- (auto-save-p (and (not ignore-auto)
+ (let* ((auto-save-p (and (not ignore-auto)
(recent-auto-save-p)
buffer-auto-save-file-name
(file-readable-p buffer-auto-save-file-name)
@@ -2771,9 +2772,9 @@ non-nil, it is called instead of rereading visited file contents."
;; any code conversion.
(if auto-save-p 'no-conversion
coding-system-for-read)))
+ ;; Note that this preserves point in an intelligent way.
(insert-file-contents file-name (not auto-save-p)
nil nil t))))
- (goto-char (min opoint (point-max)))
;; Recompute the truename in case changes in symlinks
;; have changed the truename.
(setq buffer-file-truename