GNU bug report logs - #16514
24.3.50; Region overlay looks bad on refined hunks in diff-mode

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Tue, 21 Jan 2014 04:46:01 UTC

Severity: normal

Found in version 24.3.50

To reply to this bug, email your comments to 16514 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Tue, 21 Jan 2014 04:46:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Gutov <dgutov <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 21 Jan 2014 04:46:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Region overlay looks bad on refined hunks in diff-mode
Date: Tue, 21 Jan 2014 06:44:34 +0200
1. Make some changes, save, open vc-diff buffer.

2. Extend region over the pieces of the hunk that `diff-refine-hunk'
highlighted.

If there are only a few such pieces, you only see a discrepancy between
the pieces where region starts and ends (if either is within a refined
part), because the region is partly visible there.

If most of the hunk was refined (a lot of changes), however, the region
becomes mostly invisible (aside from the bits between reginements).

In GNU Emacs 24.3.50.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.6)
 of 2014-01-13 on axl
Repository revision: 116011 monnier <at> iro.umontreal.ca-20140113153301-ozd3taipkkc7p5cr
Windowing system distributor `The X.Org Foundation', version 11.0.11405000
System Description:	Ubuntu 13.10




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Sun, 06 Dec 2020 14:56:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 16514 <at> debbugs.gnu.org
Subject: Re: bug#16514: 24.3.50; Region overlay looks bad on refined hunks
 in diff-mode
Date: Sun, 06 Dec 2020 15:55:01 +0100
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> 1. Make some changes, save, open vc-diff buffer.
>
> 2. Extend region over the pieces of the hunk that `diff-refine-hunk'
> highlighted.
>
> If there are only a few such pieces, you only see a discrepancy between
> the pieces where region starts and ends (if either is within a refined
> part), because the region is partly visible there.
>
> If most of the hunk was refined (a lot of changes), however, the region
> becomes mostly invisible (aside from the bits between reginements).

I'm not sure I understand the recipe at all, but what I did was

C-x v =

in a file that had changes, and then created a region with the mouse
over an arbitrary bit of that buffer:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
And the results don't look obviously wrong to me.  So is this something
that has been fixed already, or am I reproducing it wrong?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Dec 2020 14:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Sun, 06 Dec 2020 15:40:02 GMT) Full text and rfc822 format available.

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

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16514 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#16514: 24.3.50; Region overlay looks bad on refined hunks
 in diff-mode
Date: Sun, 06 Dec 2020 16:39:04 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I'm not sure I understand the recipe at all, but what I did was
>
> C-x v =
>
> in a file that had changes, and then created a region with the mouse
> over an arbitrary bit of that buffer:
>
> <screenshot>
>
> And the results don't look obviously wrong to me.  So is this something
> that has been fixed already, or am I reproducing it wrong?

I'm not sure I understand the original recipe either, but the following
steps do show something inconsistent IMO:

1. emacs -Q CONTRIBUTE
2. C-x v g
3. move to "461cb9217d8 CONTRIBUTE (Paul Eggert 2019-05-25 10)"
4. =
5. move to the first removed line ("Briefly, …")
6. C-SPC
7. C-f C-f …

As long as point does not go past the refinement (before the comma), the
region's background has the region face's background.

Once point moves past the refinement, only non-refined parts keep the
region face's background; refined parts keep the refinement background.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Sun, 06 Dec 2020 15:49:01 GMT) Full text and rfc822 format available.

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

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#16514: 24.3.50;
 Region overlay looks bad on refined hunks in diff-mode
Date: Sun, 06 Dec 2020 16:48:03 +0100
[Message part 1 (text/plain, inline)]
Kévin Le Gouguec <kevin.legouguec <at> gmail.com> writes:

> 1. emacs -Q CONTRIBUTE
> 2. C-x v g
> 3. move to "461cb9217d8 CONTRIBUTE (Paul Eggert 2019-05-25 10)"
> 4. =
> 5. move to the first removed line ("Briefly, …")
> 6. C-SPC
> 7. C-f C-f …
>
> As long as point does not go past the refinement (before the comma), the
> region's background has the region face's background.
>
> Once point moves past the refinement, only non-refined parts keep the
> region face's background; refined parts keep the refinement background.

I'd say "one picture is worth a thousand words", but… obviously this
saying dates from before we learned how to encode words and pictures
into bytes.

[Emacs-Screenshot-2020-12-06-16:41:33.pdf (application/pdf, attachment)]
[Emacs-Screenshot-2020-12-06-16:41:37.pdf (application/pdf, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Sun, 06 Dec 2020 15:59:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: larsi <at> gnus.org, 16514 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#16514: 24.3.50;
 Region overlay looks bad on refined hunks in diff-mode
Date: Sun, 06 Dec 2020 17:58:20 +0200
> From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
> Date: Sun, 06 Dec 2020 16:39:04 +0100
> Cc: 16514 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
> 
> As long as point does not go past the refinement (before the comma), the
> region's background has the region face's background.
> 
> Once point moves past the refinement, only non-refined parts keep the
> region face's background; refined parts keep the refinement background.

This is expected, since we sort overlays so that the one whose extent
is larger wins.

To do anything else the overlays should have priorities.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Sun, 06 Dec 2020 16:11:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 16514 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#16514: 24.3.50; Region overlay looks bad on refined hunks
 in diff-mode
Date: Sun, 06 Dec 2020 17:10:10 +0100
On Dez 06 2020, Kévin Le Gouguec wrote:

> Once point moves past the refinement, only non-refined parts keep the
> region face's background; refined parts keep the refinement background.

That's because the refine face is placed by an overlay that's above the
region overlay.  The non-refine face is part of a text property.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Sun, 06 Dec 2020 19:34:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16514 <at> debbugs.gnu.org
Subject: Re: bug#16514: 24.3.50; Region overlay looks bad on refined hunks in
 diff-mode
Date: Sun, 6 Dec 2020 21:33:12 +0200
On 06.12.2020 16:55, Lars Ingebrigtsen wrote:
> in a file that had changes, and then created a region with the mouse
> over an arbitrary bit of that buffer:

Hi Lars,

your example doesn't contain any "refined" pieces. Which are key to 
reproducing the problem.

Anyway, Kevin gave a good example.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Sun, 06 Dec 2020 19:35:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>, Kévin Le Gouguec
 <kevin.legouguec <at> gmail.com>
Cc: larsi <at> gnus.org, 16514 <at> debbugs.gnu.org
Subject: Re: bug#16514: 24.3.50; Region overlay looks bad on refined hunks in
 diff-mode
Date: Sun, 6 Dec 2020 21:34:44 +0200
On 06.12.2020 17:58, Eli Zaretskii wrote:
>> From: Kévin Le Gouguec<kevin.legouguec <at> gmail.com>
>> Date: Sun, 06 Dec 2020 16:39:04 +0100
>> Cc:16514 <at> debbugs.gnu.org, Dmitry Gutov<dgutov <at> yandex.ru>
>>
>> As long as point does not go past the refinement (before the comma), the
>> region's background has the region face's background.
>>
>> Once point moves past the refinement, only non-refined parts keep the
>> region face's background; refined parts keep the refinement background.
> This is expected, since we sort overlays so that the one whose extent
> is larger wins.
> 
> To do anything else the overlays should have priorities.

So it's probably correct from the low-level primitives POV.

But is this a good UI? And shouldn't we maybe tweak the high-level 
implementation (perhaps, the way how the refinements are applied) so 
that the behavior is better?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Sun, 06 Dec 2020 19:58:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: larsi <at> gnus.org, 16514 <at> debbugs.gnu.org, kevin.legouguec <at> gmail.com
Subject: Re: bug#16514: 24.3.50; Region overlay looks bad on refined hunks in
 diff-mode
Date: Sun, 06 Dec 2020 21:56:51 +0200
> Cc: larsi <at> gnus.org, 16514 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 6 Dec 2020 21:34:44 +0200
> 
> > This is expected, since we sort overlays so that the one whose extent
> > is larger wins.
> > 
> > To do anything else the overlays should have priorities.
> 
> So it's probably correct from the low-level primitives POV.
> 
> But is this a good UI? And shouldn't we maybe tweak the high-level 
> implementation (perhaps, the way how the refinements are applied) so 
> that the behavior is better?

I agree that the end result is not the best one.  If by "tweak the
high-level implementation" you meant something like use priorities for
the relevant overlays, then that's exactly what I tried to hint at.

IOW, yes, we should do something on the application level to cause the
selected region look consistently.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16514; Package emacs. (Mon, 07 Dec 2020 13:20:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: 16514 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#16514: 24.3.50; Region overlay looks bad on refined hunks
 in diff-mode
Date: Mon, 07 Dec 2020 14:19:18 +0100
Kévin Le Gouguec <kevin.legouguec <at> gmail.com> writes:

> I'm not sure I understand the original recipe either, but the following
> steps do show something inconsistent IMO:
>
> 1. emacs -Q CONTRIBUTE
> 2. C-x v g
> 3. move to "461cb9217d8 CONTRIBUTE (Paul Eggert 2019-05-25 10)"
> 4. =
> 5. move to the first removed line ("Briefly, …")
> 6. C-SPC
> 7. C-f C-f …
>
> As long as point does not go past the refinement (before the comma), the
> region's background has the region face's background.
>
> Once point moves past the refinement, only non-refined parts keep the
> region face's background; refined parts keep the refinement background.

Ah, thanks.  Yes, that does look pretty odd.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 20 Jan 2021 04:30:03 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 144 days ago.

Previous Next


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