all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch for lisp/autorevert.el
@ 2006-11-28  0:28 Denis Bueno
  0 siblings, 0 replies; only message in thread
From: Denis Bueno @ 2006-11-28  0:28 UTC (permalink / 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)))

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

only message in thread, other threads:[~2006-11-28  0:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-28  0:28 Patch for lisp/autorevert.el Denis Bueno

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.