From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#68374: min-width is not correctly treated by
 buffer-text-pixel-size
Date: Thu, 11 Jan 2024 12:24:04 +0200
Message-ID: <831qaomam3.fsf@gnu.org>
References: <EC5ECEDB-646A-4DAE-BD97-FB7F086C746D@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="24771"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 68374@debbugs.gnu.org
To: JD Smith <jdtsmith@gmail.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 11 11:25:26 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rNsFZ-0006HL-TE
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jan 2024 11:25:26 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rNsFG-0004ya-SI; Thu, 11 Jan 2024 05:25:10 -0500
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 <Debian-debbugs@debbugs.gnu.org>)
 id 1rNsFF-0004yR-77
 for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 05:25:05 -0500
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 <Debian-debbugs@debbugs.gnu.org>)
 id 1rNsFE-0001Y9-U0
 for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 05:25:04 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rNsFB-0001Yr-U3
 for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 05:25:01 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Eli Zaretskii <eliz@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 11 Jan 2024 10:25:01 +0000
Resent-Message-ID: <handler.68374.B68374.17049686885975@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 68374
X-GNU-PR-Package: emacs
Original-Received: via spool by 68374-submit@debbugs.gnu.org id=B68374.17049686885975
 (code B ref 68374); Thu, 11 Jan 2024 10:25:01 +0000
Original-Received: (at 68374) by debbugs.gnu.org; 11 Jan 2024 10:24:48 +0000
Original-Received: from localhost ([127.0.0.1]:58775 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rNsEy-0001YJ-0t
 for submit@debbugs.gnu.org; Thu, 11 Jan 2024 05:24:48 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47366)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@gnu.org>) id 1rNsEw-0001Y4-Ai
 for 68374@debbugs.gnu.org; Thu, 11 Jan 2024 05:24:47 -0500
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 <eliz@gnu.org>)
 id 1rNsEs-00017i-Ma; Thu, 11 Jan 2024 05:24:43 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=9wqrSpZ512DYSWrAvsizr+FjwYQPbhMZ4rodd5a1ibI=; b=ruX5bl8cTmZKAZE24Rk1
 hv5YqV0a8pqeUUOcstAcnqfQDjxUgyH/EL8/muC3Re8340sSdnC7QWLUPKNR1O21aFEvNFeo0lyxU
 ZlKhQdcnAl3mILv0r7PGdXFfdKgBTyjPwtIvyb1qWQgxT+NWjhkMiEkbVll65eHMbGRJL2cySS7I7
 BmmUUhDEv1ZRX6KgGPo1j3A/1Y2YIh1xLFLLEL9cYwHxEBLi0JoKBc5WaP6/BbMgPY5e0+Xj8dRF6
 GapaCtcH0XWWG0V7fLaflsgsP876xalDvgSSer8uLD9HfR+c0VGzaRRUCu0b7gNiL6bljud/enG7F
 BowCjSkpSo9LwQ==;
In-Reply-To: <EC5ECEDB-646A-4DAE-BD97-FB7F086C746D@gmail.com> (message from JD
 Smith on Wed, 10 Jan 2024 17:22:53 -0500)
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:277879
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/277879>

> From: JD Smith <jdtsmith@gmail.com>
> Date: Wed, 10 Jan 2024 17:22:53 -0500
> 
> 
> When the ‘display min-width property is used on characters in a buffer, window/buffer-text-pixel-size does not include this min-width padding in its calculation of the text's pixel width.  

For some reason I cannot understand, we were ignoring min-width when
simulating display (as opposed to actually displaying stuff in a
window).  I can only assume it's some kind of left-over from when Lars
was developing this feature, where calls from functions that simulate
display caused him trouble, so he disabled that and forgot to
re-enable later.  At least I cannot find any discussion of this, and
the code which disables min-width in these situations was in the
initial version that landed on master.

So please try running with the patch below for a couple of weeks, and
if it doesn't cause you any trouble, I will install it on master.
Please configure your builds with --enable-checking='yes,glyphs' for
the duration of this test period, to activate some run-time tests and
assertions that will hopefully flag any problems this change might
have.

TIA

diff --git a/src/xdisp.c b/src/xdisp.c
index 14cf030..29ac4a4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5487,9 +5487,6 @@ display_min_width (struct it *it, ptrdiff_t bufpos,
   if (!NILP (it->min_width_property)
       && !EQ (width_spec, it->min_width_property))
     {
-      if (!it->glyph_row)
-	return;
-
       /* When called from display_string (i.e., the mode line),
 	 we're being called with a string as the object, and we
 	 may be called with many sub-strings belonging to the same