From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Denis Bueno" Newsgroups: gmane.emacs.devel Subject: Bug (CVS HEAD): `before-revert-hook' not run before auto-revert-tail-mode reverts Date: Thu, 05 Jul 2007 14:33:58 -0600 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1183667745 3096 80.91.229.12 (5 Jul 2007 20:35:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 5 Jul 2007 20:35:45 +0000 (UTC) To: "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 05 22:35:43 2007 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I6Y39-0001fr-5b for ged-emacs-devel@m.gmane.org; Thu, 05 Jul 2007 22:35:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I6Y38-0002Mw-GO for ged-emacs-devel@m.gmane.org; Thu, 05 Jul 2007 16:35:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I6Y1q-0001WN-0a for emacs-devel@gnu.org; Thu, 05 Jul 2007 16:34:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I6Y1m-0001Ue-OY for emacs-devel@gnu.org; Thu, 05 Jul 2007 16:34:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I6Y1m-0001UQ-Am for emacs-devel@gnu.org; Thu, 05 Jul 2007 16:34:14 -0400 Original-Received: from mm04snlnto.sandia.gov ([132.175.109.21] helo=sentry.sandia.gov) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I6Y1l-0004fp-DN for emacs-devel@gnu.org; Thu, 05 Jul 2007 16:34:13 -0400 Original-Received: from [134.253.164.148] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.1)); Thu, 05 Jul 2007 14:33:59 -0600 X-Server-Uuid: AA8306FD-23D1-4E5B-B133-B2D9F10C3631 Original-Received: from ES21SNLNT.srn.sandia.gov ([134.253.164.104]) by ES24SNLNT.srn.sandia.gov with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Jul 2007 14:33:59 -0600 Original-Received: from 134.253.202.158 ([134.253.202.158]) by ES21SNLNT.srn.sandia.gov ([134.253.164.116]) with Microsoft Exchange Server HTTP-DAV ; Thu, 5 Jul 2007 20:33:59 +0000 User-Agent: Microsoft-Entourage/11.3.3.061214 Thread-Topic: Bug (CVS HEAD): `before-revert-hook' not run before auto-revert-tail-mode reverts Thread-Index: Ace/Q9AxDsswiCs3EdyX+wAX8tQlcQ== X-OriginalArrivalTime: 05 Jul 2007 20:33:59.0556 (UTC) FILETIME=[D11F6C40:01C7BF43] X-TMWD-Spam-Summary: TS=20070705203400; SEV=2.2.2; DFV=B2007070515; IFV=2.0.4,4.0-9; AIF=B2007070515; RPD=5.02.0125; ENG=IBF; RPDID=7374723D303030312E30413031303230332E34363844353542372E303032362C73733D312C6667733D30; CAT=NONE; CON=NONE X-MMS-Spam-Filter-ID: B2007070515_5.02.0125_4.0-9 X-WSS-ID: 6A938A3D25C695576-01-01 X-detected-kernel: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74358 Archived-At: 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)