all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Denis Bueno" <dbueno@gmail.com>
Subject: Patch for lisp/autorevert.el
Date: Mon, 27 Nov 2006 19:28:35 -0500	[thread overview]
Message-ID: <6dbd4d000611271628udd1456bl219a5e95430d6074@mail.gmail.com> (raw)

I would expect `auto-revert-tail-mode' to run `after-revert-hook'
after it reverts the buffer, on an append. Currently it doesn't. The
patch I've included [1] fixes that.

Would anyone consider installing this?

I use it to run the following hook, in my .emacs:

;; 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 (and font-lock-mode
                     (boundp 'hi-lock-mode)
                     hi-lock-mode)
                (progn
                  (message "Re-fontifying buffer...")
                  (font-lock-fontify-buffer)))))


This keeps highlighting terms as they get appended to a log file being
tailed by `auto-revert-tail-mode'.

-Denis

[1]
$ cdiff lisp/autorevert.el
Index: lisp/autorevert.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/autorevert.el,v
retrieving revision 1.55
diff -u -r1.55 autorevert.el
--- lisp/autorevert.el  6 May 2006 14:38:07 -0000       1.55
+++ lisp/autorevert.el  28 Nov 2006 00:24:29 -0000
@@ -457,6 +457,7 @@
        (save-excursion
          (goto-char (point-max))
          (insert-file-contents file nil auto-revert-tail-pos size)))
+      (run-mode-hooks 'after-revert-hook)
       (undo-boundary)
       (setq auto-revert-tail-pos size)
       (set-buffer-modified-p modified)))

                 reply	other threads:[~2006-11-28  0:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6dbd4d000611271628udd1456bl219a5e95430d6074@mail.gmail.com \
    --to=dbueno@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.