emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug (CVS HEAD): `before-revert-hook' not run before auto-revert-tail-mod


From: Denis Bueno
Subject: Bug (CVS HEAD): `before-revert-hook' not run before auto-revert-tail-mode reverts
Date: Thu, 05 Jul 2007 14:33:58 -0600
User-agent: Microsoft-Entourage/11.3.3.061214

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)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]