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


Message #14 received at 12747 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Oleksandr Gavenko <gavenkoa <at> gmail.com>
Cc: 12747 <at> debbugs.gnu.org
Subject: Re: bug#12747: 23.4;
	diff-auto-refine-mode process only last hunk in diff (must ALL).
Date: Sun, 28 Oct 2012 16:29:31 -0400
retitle 12747 Make diff-auto-refine-mode refine from jit/font-lock
severity 12747 wishlist
thanks

>> If so, that is a valid request for enhancement, and I fully agree.
> That is!

OK, title adjusted.  I also would like to see this, FWIW.

> Also I would be glad to see alias for:
>   (diff-auto-refine-mode 1)
> in form:
>   (defun diff-auto-refine-mode-on () (diff-auto-refine-mode 1))
> to simplify usage in hooks...

This is not needed any more.  Nowadays minor modes always enable the
mode if called without argument.  IOW you can just use
diff-auto-refine-mode in your hooks without risk of it toggling the
minor mode off.

>   (save-excursion
>     (goto-char (point-min))
>     (while (not (eobp))
>       (diff-hunk-next))))

Problem with this, is that it can be slow when visiting large patch
files, and it may fail to refine all hunks in *vc-diff* buffers because
that might be run before the process has finished returning the diff.

> Does this mean register MATCHER with always fail but perform side
> effect by updating suggested 'diff--regions-displayed' variable?

Yes.

> Also I can't found function that return visible to user region to proper
> highlight all visible hunks instead current...

The font-lock-keywords rule suggested before does more or less.

Otherwise, you can go through all windows, check if they're displaying
your buffer and then use window-start and window-end to figure out what
is displayed, but that approach generally leads to madness (compare
jit-lock to lazy-lock, or linum.el to nlinum.el).


        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.