GNU bug report logs - #12747
Make diff-auto-refine-mode refine from jit/font-lock

Previous Next

Package: emacs;

Reported by: Oleksandr Gavenko <gavenkoa <at> gmail.com>

Date: Sun, 28 Oct 2012 12:17:01 UTC

Severity: wishlist

Tags: fixed

Merged with 16798, 18128, 21744

Found in versions 23.4, 24.5

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Oleksandr Gavenko <gavenkoa <at> gmail.com>
Cc: 12747 <at> debbugs.gnu.org
Subject: bug#12747: 23.4; diff-auto-refine-mode process only last hunk in diff (must ALL).
Date: Sun, 28 Oct 2012 09:54:22 -0400
> If I enable diff-auto-refine-mode in all diff-mode buffers:
>   (defun my-diff-auto-refine-mode-on () (diff-auto-refine-mode 1))
>   (add-hook 'diff-mode-hook 'my-diff-auto-refine-mode-on)
> I see actions only on last hunk in diff.

I'm not sure I understand what you mean.  `diff-auto-refine-mode' does
not refine-highlight all the hunks at once (quoting the docstring):

   When enabled, Emacs automatically highlights
   changes in detail as the user visits hunks.

"as the user visits the hunks" means that it's only highlighted in
response to "n" and "p" (and a few related operations).
   
This is not a bug.  IIUC you'd like the refinement to be done in any
hunk that is ever displayed, right?
If so, that is a valid request for enhancement, and I fully agree.
If someone is interested in implementing it, here's how I think it would
have to work:
- add a font-lock-keywords rule in diff-mode which simply registers the
  region displayed in a buffer-local var `diff--regions-displayed'.
- have an idle timer that checks `diff--regions-displayed' and refines
  all the hunks in those regions (and it should also font-lock those
  hunks at the same time, so that if some of the hunk is not yet
  displayed and not yet font-locked, displaying it later on won't cause
  re-refining the hunk).


        Stefan




This bug report was last modified 7 years and 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.