unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bug (CVS HEAD): `before-revert-hook' not run before auto-revert-tail-mode reverts
@ 2007-07-05 20:33 Denis Bueno
  0 siblings, 0 replies; only message in thread
From: Denis Bueno @ 2007-07-05 20:33 UTC (permalink / raw)
  To: emacs-devel@gnu.org

I submitted a patch a while ago that runs `after-revert-hook' immediately
after auto-revert-tail-mode reverts the end of the current buffer.  I just
now realised that `before-revert-hook' never gets run *before* the revert.

I submit the current one-line-change patch [1], in the hopes of fixing this
problem.

My motivation for this change is reasonable synergy between
`auto-revert-tail-mode' and `highlight-changes-mode', in order to get Emacs
to highlight the last several changes of a log file.  Setting
`highlight-changes-rotate-faces' on `after-revert-hook' causes the
highlighted text in the buffer always to have the same face; setting
`highlight-changes-rotate-faces' on `before-revert-hook' (were it called)
corrects my problem.

Thank you.

-Denis


[1]
Index: lisp/autorevert.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/autorevert.el,v
retrieving revision 1.58
diff -u -r1.58 autorevert.el
--- lisp/autorevert.el  24 Mar 2007 13:39:21 -0000      1.58
+++ lisp/autorevert.el  5 Jul 2007 20:31:54 -0000
@@ -451,6 +451,7 @@
        (file buffer-file-name)
        buffer-file-name)               ; ignore that file has changed
     (when (> size auto-revert-tail-pos)
+      (run-mode-hooks 'before-revert-hook)
       (undo-boundary)
       (save-restriction
        (widen)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-05 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-05 20:33 Bug (CVS HEAD): `before-revert-hook' not run before auto-revert-tail-mode reverts Denis Bueno

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).