GNU bug report logs - #72721
31.0.50; Visual-wrap-prefix-mode breaks Magit log buffers

Previous Next

Package: emacs;

Reported by: Gautier Ponsinet <gautier <at> gautierponsinet.xyz>

Date: Mon, 19 Aug 2024 22:29:02 UTC

Severity: normal

Merged with 72710

Found in version 31.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 72721 <at> debbugs.gnu.org, gautier <at> gautierponsinet.xyz
Subject: Re: bug#72721: 31.0.50; Visual-wrap-prefix-mode breaks Magit log
 buffers
Date: Tue, 20 Aug 2024 14:53:30 +0300
> Date: Mon, 19 Aug 2024 17:46:18 -0700
> Cc: eliz <at> gnu.org
> From: Jim Porter <jporterbugs <at> gmail.com>
> 
> On 8/19/2024 2:39 PM, Gautier Ponsinet wrote:
> > Hello everyone,
> > 
> > The new visual-wrap-prefix-mode breaks the rendering of the Magit Log
> > buffers.
> > 
> > In emacs -Q:
> > * Install Magit and its dependencies and load Magit.
> > * Go to a local repository (via M-x dired or M-x cd).
> > * M-x global-visual-wrap-prefix-mode
> > * M-x magit-log-current
> > 
> > Could someone please confirm/reproduce?
> 
> I can confirm this. I'm not quite sure of all the details, but it seem 
> that this is due to a bad interaction between overlays and the 
> 'min-width' display spec. The end result was that we were calling 
> 'get-text-property' with a (large-ish) buffer position when the OBJECT 
> arg was a string of length 1. That can happen in magit-log on the 
> mostly-blank line where it's making the ASCII art just below a merge 
> commit. (The leading whitespace makes 'visual-wrap-prefix-mode' do its 
> thing.)
> 
> I'm not super familiar with how the display engine works, but I think we 
> don't want to call 'display_min_width' when we're working with an 
> overlay. See the attached patch.

I'd appreciate a reproducer without Magit, as I don't have it
installed and would prefer not to have to.

> Eli, I'm sure you understand this code much better than me. Does the 
> above make sense? I can also try to improve the commentary in the code, 
> but I'm just making some educated guesses as to what's happening here.

It looks like you are breaking min-width support for display strings?
They are used on the mode line and also in other places, and in
general, min-width should treat buffers and strings alike.  Can you
explain the motivation for the proposed changes, and describe what you
saw with the current code in this case?  Where's the call to
get-text-property and why did it use a buffer position instead of a
string position?




This bug report was last modified 264 days ago.

Previous Next


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