all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [dbueno@gmail.com: Patch enabling after-revert-hook for auto-revert-tail-mode]
@ 2007-03-08 21:48 Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2007-03-08 21:48 UTC (permalink / raw)
  To: Anders Lindgren; +Cc: emacs-devel

Do you agree with this change?

------- Start of forwarded message -------
X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY 
	autolearn=failed version=3.1.0
DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta;
	h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
	b=Am/Ew8qlpZcpoiqvg/PNX9nhMDeFjKKAHmxRMYSOiNuMkvsESIts3BRqVzs4RdCphYqh5HWgbw8iv66699kkLnBPVXbuEUttwVHQaWnaG9SzFx4eSGvIY6RNz1MHD6TDg97JgJYKiUSgBCBzUEMamemaUafJErkfvJNH/wLRk2A=
Date: Wed, 7 Mar 2007 20:42:52 -0500
From: "Denis Bueno" <dbueno@gmail.com>
To: emacs-devel@gnu.org
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Disposition: inline
Subject: Patch enabling after-revert-hook for auto-revert-tail-mode

Dear emacs-devel:

A while back I wanted two things to interact the way I expected:
hi-lock-mode and auto-revert-tail-mode. I wanted terms highlighted by
hi-lock-mode to continue to be highlighted after a revert by
auto-revert-tail-mode. But my hook (which refontifies the buffer)
wasn't getting executed after a revert.

The reason is, of course, obvious: after-revert-hook wasn't called. My
patch calls it  at the most obvious place I could think of.

It's a one-line change -- not much can go wrong, I think. I have been
using this change for many months now (and have recompiled emacs 6-8
times during that period). Please consider applying it. It is useful,
and seems like this is the way it should be  -- after-revert-hook
should happen after reverting the tail of the file.

- -Denis

Index: lisp/autorevert.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/autorevert.el,v
retrieving revision 1.56
diff -u -r1.56 autorevert.el
- --- lisp/autorevert.el  21 Jan 2007 03:53:12 -0000      1.56
+++ lisp/autorevert.el  8 Mar 2007 01:37:11 -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)))


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dbueno@gmail.com: Patch enabling after-revert-hook for auto-revert-tail-mode]
       [not found] <E1HRK5y-0007Bl-M2@fencepost.gnu.org>
@ 2007-03-17 20:38 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2007-03-17 20:38 UTC (permalink / raw)
  To: rms; +Cc: Anders Lindgren, emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Anders Lindgren did not respond.  Would someone please check this patch?
> If it seems correct, please install it.
>
> Please ack.

Seems correct; I checked it in.

> From: "Denis Bueno" <dbueno@gmail.com>
> Subject: Patch enabling after-revert-hook for auto-revert-tail-mode
> To: emacs-devel@gnu.org
>
> Dear emacs-devel:
>
> A while back I wanted two things to interact the way I expected:
> hi-lock-mode and auto-revert-tail-mode. I wanted terms highlighted by
> hi-lock-mode to continue to be highlighted after a revert by
> auto-revert-tail-mode. But my hook (which refontifies the buffer)
> wasn't getting executed after a revert.
>
> The reason is, of course, obvious: after-revert-hook wasn't called. My
> patch calls it  at the most obvious place I could think of.
>
> It's a one-line change -- not much can go wrong, I think. I have been
> using this change for many months now (and have recompiled emacs 6-8
> times during that period). Please consider applying it. It is useful,
> and seems like this is the way it should be  -- after-revert-hook
> should happen after reverting the tail of the file.
>
> - -Denis
>
> Index: lisp/autorevert.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/autorevert.el,v
> retrieving revision 1.56
> diff -u -r1.56 autorevert.el
> - --- lisp/autorevert.el  21 Jan 2007 03:53:12 -0000      1.56
> +++ lisp/autorevert.el  8 Mar 2007 01:37:11 -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)))
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
> ----------
>
>
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-17 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1HRK5y-0007Bl-M2@fencepost.gnu.org>
2007-03-17 20:38 ` [dbueno@gmail.com: Patch enabling after-revert-hook for auto-revert-tail-mode] Chong Yidong
2007-03-08 21:48 Richard Stallman

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.