From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Denis Bueno" Newsgroups: gmane.emacs.help Subject: Refontifying after revert in hi-lock-mode Date: Tue, 21 Nov 2006 19:24:37 -0500 Message-ID: <6dbd4d000611211624l4e3dc33v3031b62b76b2aaaf@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1164155106 30285 80.91.229.2 (22 Nov 2006 00:25:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Nov 2006 00:25:06 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 22 01:25:04 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gmfv5-00014n-CB for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Nov 2006 01:24:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gmfv4-0001Zg-KV for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Nov 2006 19:24:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gmfut-0001ZX-5y for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 19:24:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gmfup-0001YY-Hy for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 19:24:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gmfup-0001YV-FN for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 19:24:39 -0500 Original-Received: from [64.233.182.189] (helo=nf-out-0910.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gmfup-0002hn-B1 for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 19:24:39 -0500 Original-Received: by nf-out-0910.google.com with SMTP id d4so348893nfe for ; Tue, 21 Nov 2006 16:24:37 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=lT8ocChFyvIUQYsLiNx9i2A8VlLgor/M5AsESEnTy1IeWByc9Jo58czNGLQQWKcnDwa9HX58uFLHn4DNb2iFeKyWuYuegREFbKtLeepgylfQVptqSmUThq8lccgfp06FA4e+Re9f3L/+cnILd/PDGz1Scp0Yxt7x+HYUSf8QNFQ= Original-Received: by 10.78.204.7 with SMTP id b7mr7166408hug.1164155077045; Tue, 21 Nov 2006 16:24:37 -0800 (PST) Original-Received: by 10.78.100.6 with HTTP; Tue, 21 Nov 2006 16:24:37 -0800 (PST) Original-To: help-gnu-emacs Content-Disposition: inline X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38870 Archived-At: I would like a synergy between auto-revert-tail-mode and hi-lock-mode. I frequently tail log files, and would like live updates of highlighted terms in those log files. In my Emacs (GNU Emacs 22.0.90.2 (powerpc-apple-darwin8.8.0, Carbon Version 1.6.0) of 2006-11-11 on ford.local), after a revert performed by auto-revert-tail-mode, I would like any new terms matching active regexps to be highlighted. But they aren't. I tried the following hook, it my .emacs, and I'm not quite sure why it fails: ,---- | ;; In auto-revert mode, after reverting, if font-lock is turned on, | ;; fontify the buffer. I intend for this to re-fontify my buffers when they | ;; revert and I'm using hi-lock-mode. | (require 'autorevert) | (add-hook 'after-revert-hook | (lambda () | (if font-lock-mode | (progn | (message "Re-fontifying buffer...") | (font-lock-fontify-buffer))) | (message "dbueno's after-revert-hook finished."))) `---- I looked into autorevert.el to verify that auto-revert-tail-mode indeed uses `revert-buffer', so, I think that hook should be executed. I figured that maybe there was a `revert-buffer-function' in use when `revert-buffer' is called, which (as the doc for `revert-buffer' says: "If the value of `revert-buffer-function' is non-nil, it is called to do all the work for this command. Otherwise, the hooks `before-revert-hook' and `after-revert-hook' are run at the beginning and the end, and if `revert-buffer-insert-file-contents-function' is non-nil, it is called instead of rereading visited file contents." Does anyone know why my hook wouldn't run? and if so, how I can fix it? Thanks in advance.