unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: emacs-devel@gnu.org
Subject: [denbuen@sandia.gov: Bug (CVS HEAD): `before-revert-hook' not run before auto-revert-tail-mode reverts]
Date: Fri, 06 Jul 2007 00:38:51 -0400	[thread overview]
Message-ID: <E1I6fal-0006Rx-7s@fencepost.gnu.org> (raw)

Would someone please DTRT with this, then ack?

------- Start of forwarded message -------
X-Spam-Status: No, score=1.3 required=5.0 tests=RCVD_NUMERIC_HELO,SPF_PASS,
	UNPARSEABLE_RELAY autolearn=no version=3.1.0
Date: Thu, 05 Jul 2007 14:33:58 -0600
From: "Denis Bueno" <denbuen@sandia.gov>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Thread-Topic: Bug (CVS HEAD): `before-revert-hook' not run before
	auto-revert-tail-mode reverts
Thread-Index: Ace/Q9AxDsswiCs3EdyX+wAX8tQlcQ==
MIME-Version: 1.0
Content-Type: text/plain;
 charset=us-ascii
Subject: Bug (CVS HEAD): `before-revert-hook' not run before
 auto-revert-tail-mode reverts

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)




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

             reply	other threads:[~2007-07-06  4:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06  4:38 Richard Stallman [this message]
2007-07-06 12:59 ` Fwd: Bug (CVS HEAD): `before-revert-hook' not run before auto-revert-tail-mode reverts Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=E1I6fal-0006Rx-7s@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).