summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorVinicius Jose Latorre <viniciusjl@ig.com.br>2007-12-11 00:26:52 +0000
committerVinicius Jose Latorre <viniciusjl@ig.com.br>2007-12-11 00:26:52 +0000
commitbb14938c9ff60e83fc2bc17ff5af83ea7648688d (patch)
tree73ca5da30469256b6efe7c231c47f29a7a85feef /lisp
parentaa5fea59c1ed01e895877a623ba893846d3d32ed (diff)
downloademacs-bb14938c9ff60e83fc2bc17ff5af83ea7648688d.tar.gz
emacs-bb14938c9ff60e83fc2bc17ff5af83ea7648688d.tar.bz2
emacs-bb14938c9ff60e83fc2bc17ff5af83ea7648688d.zip
revert-buffer eliminates overlays and the mark
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/files.el16
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 701a0071745..09a3e801ddd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2007-12-10 Yoni Rabkin Katzenell <yoni-r@actcom.com> (tiny change)
+
+ * file.el (revert-buffer): Eliminate overlays and the mark.
+
2007-12-10 Stefan Monnier <monnier@iro.umontreal.ca>
* server.el (server-select-display): Fix important typo.
diff --git a/lisp/files.el b/lisp/files.el
index 8d5fcfda8c2..e6f957f480f 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4204,10 +4204,12 @@ 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.
-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 @@ non-nil, it is called instead of rereading visited file contents."
(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