From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72721: 31.0.50; Visual-wrap-prefix-mode breaks Magit log buffers Date: Tue, 20 Aug 2024 14:53:30 +0300 Message-ID: <86jzgbwgud.fsf@gnu.org> References: <87cym4ry3e.fsf@gautierponsinet.xyz> <49828281-6a20-3791-91bd-9708ec51eb57@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12042"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72721@debbugs.gnu.org, gautier@gautierponsinet.xyz To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 20 13:54:53 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sgNRs-0002yy-UD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Aug 2024 13:54:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgNRR-0003TI-6w; Tue, 20 Aug 2024 07:54:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgNRO-0003Su-6m for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 07:54:24 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sgNRM-0001CY-Bl for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 07:54:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=axFE46ABiuZp9vMGL3mWl0d52RHMcOWXC8HDwzu1Guw=; b=MoPN1E/mZgWWCoeXKPhY8PeBfXnYklwVG3rd+roZTJX9fPJCmw9mg/IjPPDEgzWuJRIN9M3+aDYrskb+AwF1h3zZZyi3TNHZ9RrquTrEjQLAJIKJj5F59vruLZ2knBFQ9lJ+oUu0ENEEYEFCLEDnXSeEl3t3e88VpXAxUEjZwFknQ3PWF/SDVTmEmSBNSBWj7pX1ksixVF1KjeQC3gUIcMfNlV39tPX2Vn+dwDCvjfXLF2C1cjJNZtZ1y2lleNRePx4Fgkc+9+hgjC2/nSyR4gQMFc8WtfOSOcORmh+BUwdyPGO8WH6kYBYR7uO8h4sBj979YRwhrGJWr6wFOOTpAA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sgNS2-0007uW-8I for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 07:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Aug 2024 11:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72721 X-GNU-PR-Package: emacs Original-Received: via spool by 72721-submit@debbugs.gnu.org id=B72721.172415486930357 (code B ref 72721); Tue, 20 Aug 2024 11:55:02 +0000 Original-Received: (at 72721) by debbugs.gnu.org; 20 Aug 2024 11:54:29 +0000 Original-Received: from localhost ([127.0.0.1]:59969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgNRV-0007tZ-En for submit@debbugs.gnu.org; Tue, 20 Aug 2024 07:54:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgNRR-0007tF-5k for 72721@debbugs.gnu.org; Tue, 20 Aug 2024 07:54:27 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgNQd-000187-80; Tue, 20 Aug 2024 07:53:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=axFE46ABiuZp9vMGL3mWl0d52RHMcOWXC8HDwzu1Guw=; b=VF6v/VwustxZ mih46KFFZHb1ojUT6uRm5Oe+nuPaNVZgnkQNriW1R6iGdtt9NKwXOyvhot6LH1V02X401f2yBaxEc gOjgMWyWZ0GYuL2MEIQFdML30hp6V4uPZdAaUl7z+TzT+ExoVXDUQFYS0+DLFgac4CQYg4yg4UT0L bcYOWlE4VxOHCwaHPsk/MUG2MqSpGL09fiBKKgCWDFkCbjVIwsQArZqdfTMTI/5FNO6ZSonkDVO2q Kt2agLl7BrBG92OqfHA5tDb9OqmS3cAWlUEYkuj/8uaBlxzMdvLLp1OvIbyAkGfn+iXclmmSicY7u frN7BiZHBiBLXfbSAQISQg==; In-Reply-To: <49828281-6a20-3791-91bd-9708ec51eb57@gmail.com> (message from Jim Porter on Mon, 19 Aug 2024 17:46:18 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290435 Archived-At: > Date: Mon, 19 Aug 2024 17:46:18 -0700 > Cc: eliz@gnu.org > From: Jim Porter > > 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?