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#52302: 28.0.50; [PATCH] Overlay strings should not increment vpos Date: Mon, 06 Dec 2021 22:02:54 +0200 Message-ID: <8335n51oy9.fsf@gnu.org> References: <87v903hs0w.fsf@dick> <875ys1ikgu.fsf@dick> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7434"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52302@debbugs.gnu.org To: dick Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 06 21:05:28 2021 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 1muKEq-0001es-8x for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 21:05:28 +0100 Original-Received: from localhost ([::1]:42410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muKEp-0004ZW-C0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 15:05:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muKDT-0003n5-2y for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 15:04:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muKDS-0008Ov-Py for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 15:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1muKDS-0007bC-GA for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 15:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Dec 2021 20:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52302 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52302-submit@debbugs.gnu.org id=B52302.163882098929146 (code B ref 52302); Mon, 06 Dec 2021 20:04:02 +0000 Original-Received: (at 52302) by debbugs.gnu.org; 6 Dec 2021 20:03:09 +0000 Original-Received: from localhost ([127.0.0.1]:35503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muKCa-0007a2-U9 for submit@debbugs.gnu.org; Mon, 06 Dec 2021 15:03:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muKCY-0007ZW-Kp for 52302@debbugs.gnu.org; Mon, 06 Dec 2021 15:03:07 -0500 Original-Received: from [2001:470:142:3::e] (port=39574 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muKCP-0007qe-01; Mon, 06 Dec 2021 15:02:58 -0500 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=c2w3wvq66qTvjdd8Htgpac/Z8z+EtwGRo+G4XDGyg/4=; b=la1bSIh42LZh U1lrEGySAH9UIHBE4VwderS1as1hroXRBFf8MZS9sYOcK1acfkLGpVvdH2/fiu95hF29iMB1FQiqx V4k5clcqBY0J/4Tr87bGdOute+c33DmfMoX6NQlXv04p6ZR3t0v6M489fDSXalpeV2ajOpFMVjb+0 2dsXf5ZyA++yqAJAbTfjCckUtFUr0lV0iTYMOrxfjqI64NyGDedXpIgEz5np+xSGx/qklwZiNDBDW jtmoLJ8D36ZosN3dvcsOjliNO5cmWAeaWoAOz0/c1p4T+SX0sSRIfx//Ny1MOqDy5JjzK7rG0uRVd VlUA48j+0lKteA93bUX+rQ==; Original-Received: from [87.69.77.57] (port=4465 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muKCO-0003B1-5N; Mon, 06 Dec 2021 15:02:57 -0500 In-Reply-To: <875ys1ikgu.fsf@dick> (message from dick on Mon, 06 Dec 2021 14:47:45 -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" 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" Xref: news.gmane.io gmane.emacs.bugs:221785 Archived-At: > From: dick > Date: Mon, 06 Dec 2021 14:47:45 -0500 > > A more dangerous change like the below would break the cycle of fixes > that minimize impact while maximizing obfuscation. > > >From 5f734c1d50953836dda444b8371642c6f20d4065 Mon Sep 17 00:00:00 2001 > From: dickmao > Date: Mon, 6 Dec 2021 14:30:17 -0500 > Subject: [PATCH] A small change with disastrous potential > > * src/xdisp.c (move_it_in_display_line_to): How this function has > managed to get by without a notion of visibility is a real mystery. > --- > src/xdisp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/xdisp.c b/src/xdisp.c > index 0ff6286af74..1522c6b3193 100644 > --- a/src/xdisp.c > +++ b/src/xdisp.c > @@ -9561,7 +9561,7 @@ #define IT_RESET_X_ASCENT_DESCENT(IT) \ > > PRODUCE_GLYPHS (it); > > - if (it->area != TEXT_AREA) > + if (it->area != TEXT_AREA || it->method == GET_FROM_STRING) > { > prev_method = it->method; > if (it->method == GET_FROM_BUFFER) I don't understand this change. Glyphs delivered from display and overlay strings are subject to wrapping and truncation exactly like glyphs delivered from buffer text. Only glyphs that are written into the display margins are silently truncated. So I don't think your additional condition is correct. For example, what happens if there's a display or overlay string that is very long, so that it overflows the window width? This additional condition will cause the code behave as if the window had infinite width, for the whole time it traverses the string.