# HG changeset patch # User Vinicius Jose Latorre # Date 1197332812 0 # Node ID 415e3088cd6ca52532ae3e5f47156af7d1ca62cb # Parent 9e7453c93f6d531a99e2baeb11431be7dab4f088 revert-buffer eliminates overlays and the mark diff -r 9e7453c93f6d -r 415e3088cd6c lisp/ChangeLog --- a/lisp/ChangeLog Mon Dec 10 17:02:42 2007 +0000 +++ b/lisp/ChangeLog Tue Dec 11 00:26:52 2007 +0000 @@ -1,3 +1,7 @@ +2007-12-10 Yoni Rabkin Katzenell (tiny change) + + * file.el (revert-buffer): Eliminate overlays and the mark. + 2007-12-10 Stefan Monnier * server.el (server-select-display): Fix important typo. diff -r 9e7453c93f6d -r 415e3088cd6c lisp/files.el --- a/lisp/files.el Mon Dec 10 17:02:42 2007 +0000 +++ b/lisp/files.el Tue Dec 11 00:26:52 2007 +0000 @@ -4204,10 +4204,12 @@ With a prefix argument, offer to revert from latest auto-save file, if that is more recent than the visited file. -This command also works for special buffers that contain text which -doesn't come from a file, but reflects some other data base instead: -for example, Dired buffers and `buffer-list' buffers. In these cases, -it reconstructs the buffer contents from the appropriate data base. +This command also implements an interface for special buffers +that contain text which doesn't come from a file, but reflects +some other data instead (e.g. Dired buffers, `buffer-list' +buffers). This is done via the variable +`revert-buffer-function'. In these cases, it should reconstruct +the buffer contents from the appropriate data. 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 @@ -4323,7 +4325,11 @@ (insert-file-contents file-name (not auto-save-p) nil nil t)) (insert-file-contents file-name (not auto-save-p) - nil nil t))))) + nil nil t)) + ;; Reset the mark and remove all overlays. + (setq mark-active nil + mark-ring nil) + (remove-overlays)))) ;; Recompute the truename in case changes in symlinks ;; have changed the truename. (setq buffer-file-truename