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: Sun, 05 Dec 2021 20:34:50 +0200 Message-ID: <83lf0y3np1.fsf@gnu.org> References: <87v903hs0w.fsf@dick> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4862"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52302@debbugs.gnu.org To: dick.r.chiang@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 05 19:36:33 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 1mtwNE-00012X-Fe for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Dec 2021 19:36:32 +0100 Original-Received: from localhost ([::1]:55074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtwND-0006g3-01 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Dec 2021 13:36:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtwMk-0006eK-SY for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 13:36:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtwMk-0004CS-Je for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 13:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtwMk-0001KC-Dd for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 13:36: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: Sun, 05 Dec 2021 18:36: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.16387293035018 (code B ref 52302); Sun, 05 Dec 2021 18:36:02 +0000 Original-Received: (at 52302) by debbugs.gnu.org; 5 Dec 2021 18:35:03 +0000 Original-Received: from localhost ([127.0.0.1]:59424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtwLn-0001Is-6T for submit@debbugs.gnu.org; Sun, 05 Dec 2021 13:35:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtwLl-0001IJ-EY for 52302@debbugs.gnu.org; Sun, 05 Dec 2021 13:35:01 -0500 Original-Received: from [2001:470:142:3::e] (port=46264 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 1mtwLg-000458-4P; Sun, 05 Dec 2021 13:34:56 -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=F+a5kbErkA+2MGJ62uYbwJ0GXEcPWL1JnjAgsCCedF4=; b=H8Zg83HP6Tsb i98rAfE0Ti4Avq7iYq4+rNnmZdhAuneh0ZiDbNFyVTBPfbRPEYtgbm5/KnoBZshee/Zh4v5OFTH6S U4auRfivVgXdeUxI8/0uxOuc9z+90p5foJetwJrPGyBh0xA0Ssb1kw/lupW5378tu69viVERtC5O3 N2nEAnLpOLuaGZMBPfn47+CLcNisHj/g8TAK/gUaD03vWAc/ruvI33rXvgCfAex7NXBQ5zsbWGEZv zVn8XfDqaH2drw6Sa830U46ZpPwN6MN6fUqPSksSovsL6EEox/8jp0w2ntyq8YJmO2iw1HeWwkPNK grSTJ7vdbjMKkxAWWfzpVw==; Original-Received: from [87.69.77.57] (port=1698 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 1mtwLf-0001UB-Td; Sun, 05 Dec 2021 13:34:56 -0500 In-Reply-To: <87v903hs0w.fsf@dick> (dick.r.chiang@gmail.com) 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:221632 Archived-At: > From: dick.r.chiang@gmail.com > Date: Sun, 05 Dec 2021 12:37:35 -0500 > > >From 010b26de2993754db6bb42243b5c6c89fc5e8a50 Mon Sep 17 00:00:00 2001 > From: dickmao > Date: Sun, 5 Dec 2021 12:25:32 -0500 > Subject: [PATCH] Overlay strings at `to_charpos` should not increment vpos > > Previously, two calls to `move_it_vertically_backward (it, 0)` were > required to get IT back to line start. It should only ever > take one call. Please tell more about the motivation. In which use cases this change behaves better, and why? This is a delicate code, used in many places, so we need a very good understanding of what gets fixed. > + else if (skip == MOVE_LINE_CONTINUED > + && it->method == GET_FROM_STRING > + && IT_CHARPOS (*it) == to_charpos) > + /* TO_CHARPOS reached, now consuming overlay string. */ it->method == GET_FROM_STRING doesn't necessarily mean we are it->consuming an overlay string. It could be a string from display it->property, for example. > - ++it->vpos; > + if (! reached_continued) > + ++it->vpos; I don't think I see the connection between the above condition and the need to increment (or not increment) VPOS. Can you elaborate on that? > @@ -10490,11 +10497,11 @@ move_it_vertically_backward (struct it *it, int dy) > || (it2.method == GET_FROM_STRING > && IT_CHARPOS (it2) == start_pos > && SREF (it2.string, IT_STRING_BYTEPOS (it2) - 1) == '\n'))); > - eassert (IT_CHARPOS (*it) >= BEGV); > + eassert (IT_CHARPOS (it2) >= BEGV); > SAVE_IT (it3, it2, it3data); > > move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS); > - eassert (IT_CHARPOS (*it) >= BEGV); > + eassert (IT_CHARPOS (it2) >= BEGV); Why are you replacing the assertions here? > --- a/test/src/xdisp-tests.el > +++ b/test/src/xdisp-tests.el What exactly is changed in this test? It looks like purely stylistic changes to me (which for some reason also lots the comments). Did I miss something?