diff options
| author | Richard M. Stallman | 1999-07-05 22:49:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-07-05 22:49:45 +0000 |
| commit | 2df32500abcc5219a66119d2a6b32cebf97e7722 (patch) | |
| tree | 78b316bac881d8287148d7a80631dc7cbf8d33cb | |
| parent | 8f3c1d763f2d433eae357a60d210910d0ed7e252 (diff) | |
| download | emacs-2df32500abcc5219a66119d2a6b32cebf97e7722.tar.gz emacs-2df32500abcc5219a66119d2a6b32cebf97e7722.zip | |
(revert-buffer): Don't preserve point here.
(revert-buffer-insert-file-contents-function): Doc fix.
| -rw-r--r-- | lisp/files.el | 9 |
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.") | |||
| 2657 | (defvar revert-buffer-insert-file-contents-function nil | 2657 | (defvar revert-buffer-insert-file-contents-function nil |
| 2658 | "Function to use to insert contents when reverting this buffer. | 2658 | "Function to use to insert contents when reverting this buffer. |
| 2659 | Gets two args, first the nominal file name to use, | 2659 | Gets two args, first the nominal file name to use, |
| 2660 | and second, t if reading the auto-save file.") | 2660 | and second, t if reading the auto-save file. |
| 2661 | |||
| 2662 | The function you specify is responsible for updating (or preserving) point.") | ||
| 2661 | 2663 | ||
| 2662 | (defvar before-revert-hook nil | 2664 | (defvar before-revert-hook nil |
| 2663 | "Normal hook for `revert-buffer' to run before reverting. | 2665 | "Normal hook for `revert-buffer' to run before reverting. |
| @@ -2714,8 +2716,7 @@ non-nil, it is called instead of rereading visited file contents." | |||
| 2714 | (interactive (list (not current-prefix-arg))) | 2716 | (interactive (list (not current-prefix-arg))) |
| 2715 | (if revert-buffer-function | 2717 | (if revert-buffer-function |
| 2716 | (funcall revert-buffer-function ignore-auto noconfirm) | 2718 | (funcall revert-buffer-function ignore-auto noconfirm) |
| 2717 | (let* ((opoint (point)) | 2719 | (let* ((auto-save-p (and (not ignore-auto) |
| 2718 | (auto-save-p (and (not ignore-auto) | ||
| 2719 | (recent-auto-save-p) | 2720 | (recent-auto-save-p) |
| 2720 | buffer-auto-save-file-name | 2721 | buffer-auto-save-file-name |
| 2721 | (file-readable-p buffer-auto-save-file-name) | 2722 | (file-readable-p buffer-auto-save-file-name) |
| @@ -2771,9 +2772,9 @@ non-nil, it is called instead of rereading visited file contents." | |||
| 2771 | ;; any code conversion. | 2772 | ;; any code conversion. |
| 2772 | (if auto-save-p 'no-conversion | 2773 | (if auto-save-p 'no-conversion |
| 2773 | coding-system-for-read))) | 2774 | coding-system-for-read))) |
| 2775 | ;; Note that this preserves point in an intelligent way. | ||
| 2774 | (insert-file-contents file-name (not auto-save-p) | 2776 | (insert-file-contents file-name (not auto-save-p) |
| 2775 | nil nil t)))) | 2777 | nil nil t)))) |
| 2776 | (goto-char (min opoint (point-max))) | ||
| 2777 | ;; Recompute the truename in case changes in symlinks | 2778 | ;; Recompute the truename in case changes in symlinks |
| 2778 | ;; have changed the truename. | 2779 | ;; have changed the truename. |
| 2779 | (setq buffer-file-truename | 2780 | (setq buffer-file-truename |