Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 11:27:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 24 07:27:46 2025
Received: from localhost ([127.0.0.1]:43979 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1uq8t0-0004a2-JO
for submit <at> debbugs.gnu.org; Sun, 24 Aug 2025 07:27:46 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33658)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uq8sy-0004Zm-RV
for 79241 <at> debbugs.gnu.org; Sun, 24 Aug 2025 07:27:45 -0400
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@HIDDEN>)
id 1uq8st-0000Jo-Gj; Sun, 24 Aug 2025 07:27:39 -0400
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=EO4ssntRvvpLrZnpZY7pZjR3fVIGOQXw63UvX5WZzRc=; b=KbvepHX7XN34zUgy1OWA
qK8lHq2uPkB4pwd36VQmdMX3sKdKXPQbQJTDtHyDrDZpQb+VeeGjPHDJe+Wd5caVILdE0S+ViascG
e27vGj4SqYmob4wenh/RZ7VUsaU/y8SsTo4hEP/gHI2vRafi9KDmq3/VOsBBELxitgThzEzxR+agn
EdZaBWk1/OS3y6/UNb7ClYDbr18KVo0/+N0rriom7XoqvuADwjTD1ykQSedBiLzSxylvmwNmmQ9vE
UZJ4y1XBL2It67BAiHnRc7RWVG5fe9iw5evmtYoKZHJtIB+HSp1YYMT7Uwi0x24gPtZUG4hTLS2ky
KXNDGs8bpapa5w==;
Date: Sun, 24 Aug 2025 14:27:32 +0300
Message-Id: <86ldn96jtn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sergio Pastor =?iso-8859-1?Q?P=E9rez?= <sergio.pastorperez@HIDDEN>
In-Reply-To: <20250824111320.10695-1-sergio.pastorperez@HIDDEN> (message
from Sergio Pastor =?iso-8859-1?Q?P=E9rez?= on Sun, 24 Aug 2025 13:13:01
+0200)
Subject: Re: bug#79241: [PATCH v2] Fix incorrect handling of overlays in
`vertical-motion'
References: <87ectdt28u.fsf@HIDDEN>
<20250824111320.10695-1-sergio.pastorperez@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79241
Cc: 79241 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
> Cc: Sergio Pastor Pιrez <sergio.pastorperez@HIDDEN>
> From: Sergio Pastor Pιrez <sergio.pastorperez@HIDDEN>
> Date: Sun, 24 Aug 2025 13:13:01 +0200
>
> * src/indent.c (vertical-motion): If point is inside an overlay, reset
> it to the beginning of line before trying to reach goal column. This
> prevents point from being stuck at the beginning of overlay strings
> during upward motions.
> ---
> src/indent.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/indent.c b/src/indent.c
> index b4f3c349dc5..01865c1494f 100644
> --- a/src/indent.c
> +++ b/src/indent.c
> @@ -2506,6 +2506,9 @@ line (if such column exists on that line, that is). If the line is
> an addition to the hscroll amount. */
> if (!NILP (lcols))
> {
> + if (it.method == GET_FROM_STRING)
> + reseat_at_previous_visible_line_start(&it);
> +
> move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
> /* If we find ourselves in the middle of an overlay string
> which includes a newline after current string position,
Is this needed only for overlays? What about 'display' text
properties? (There are also other cases when it.method could be
GET_FROM_STRING.) If this is only for overlay strings, we need to use
if (it.method == GET_FROM_STRING && !NILP (it.from_overlay))
instead. Please test this at least with 'display' property strings
instead of overlay strings, and see if the same problem happens in
that case. Then we will be able to decide how to write the condition
in this case.
Thanks.
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 11:18:15 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 24 07:18:15 2025 Received: from localhost ([127.0.0.1]:43953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uq8jn-00045T-Er for submit <at> debbugs.gnu.org; Sun, 24 Aug 2025 07:18:15 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:43336) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <sergio.pastorperez@HIDDEN>) id 1uq8jl-00045C-4m for 79241 <at> debbugs.gnu.org; Sun, 24 Aug 2025 07:18:13 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-45a15fd04d9so29941855e9.1 for <79241 <at> debbugs.gnu.org>; Sun, 24 Aug 2025 04:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756034287; x=1756639087; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=3ydFGyePiZD397+yK0O7NrZPgIRL3rphmTY4mbieMJw=; b=EO7u2iLTqwPhGmTL50ndC/3yjQuNK+90acjzu7AIu1r2sbVbICBbipfkhpnWguLUhq xEWSRzS69erN79rGJ7o4xZMK0mZUFo7q+v6IZwOGRoyc4k9rVV3dRYewSWAXfhkPFyHl ltlxPA9Eo9QTPIvxyPBsGrJp/LNitkcJQm6/BVvg7EPxpQ1XIfMkYpVmC546ydxs1dqI h7O6ExS8QVJPcqsmp/Jo53cnS56D+30w8n8EDlIhdX3Gb9LJVLIoR6ybQ/TLx4XCw3Sa xufZMU9FUEHOx3Yp79a9pdEKJcQSAzLMMu2nfp+09+u5hRwJjdDK8rHH6JPq5+h64QcN RaDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756034287; x=1756639087; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3ydFGyePiZD397+yK0O7NrZPgIRL3rphmTY4mbieMJw=; b=iMqoFqUpOsCYWFAjx9m1qwitCAMquwqCI8kRBDVh1TjCreb6Ferd+6JeT4BfYKbyYz UaUhAPYTY7vLFfw06r3p9AE74bV0wbnK7zZ5nUzDu+BuOlOUJIgMTBKNSO+osGtF3FwO HJkhwL4pP/lvBa9oIgHbzoP9Y/oz5uGpVZoIJ4fOZBxructwcIEaZXBln/LpplIqgSxw j1L4y/tP86KuG0JypNDKCbcoyqo42V4rl9FrgSImN2fpvIC9UQaSD0EW4NiLtNaFt0n2 tNvkIy9LkENgc4/Fmdd9BRJ/ugvMAkoQSsRpJHbIgbtlE3HC3PvzEZK1RD8yqde49WVu hl5Q== X-Gm-Message-State: AOJu0Yw7z0N7mSkvdlCvW0nna5CYvcyA+F8PywxCDaOhMoPiarqnNmXH Bi7WquP7/RkyYgjy1VfB7rAPhDBZi9u0YuJAEP2SboPjSbF78wC9CMt0RqbFjQ== X-Gm-Gg: ASbGncstflRg9U+JNEKyZ1fhOIMsAq/mUnjJAr5V+8VdVbRyCLqgIhQ7+4lrSeKM2Zp drJAZQeYP5a3iPPDFgo7DXPeKxKC7y1Wl/iyhocyaq/7qLV3Z9kxRfK4A+6sk+5anNCqM1nPKr+ ALAHvWDF0OnRmMbxHwOnfh4V5uBYtG2spKed9PAqytCKN2DP2GJZVEKx4525lXYXCia7wA9etsc j7RpTZ68+M0jtGwHIXroOb+ZJX1XQikbp5196MzTJrB17Jhtt/r7EhWuFE65gkyIzf2yzTFYZA+ Y2iKJbjPXneH4YUH4u7gloirAZM/4bRgfo5MOkq+nDU+ejDDecy2HrQUkGSG0sVZpnYFj2WgwON yqzXvspXKc0fHYE645ZLh67/bN7+rmeV5dcXDgaDDMq0SLQ== X-Google-Smtp-Source: AGHT+IHj7gGhtl0/6ocTQjL2m3dslo86zNA8HueNW1I5PFQ4pbKKmEaE+I1Z6jfGqsF8cOj6JSrssg== X-Received: by 2002:a05:600c:4683:b0:459:443e:b18a with SMTP id 5b1f17b1804b1-45b51798ef1mr71708505e9.14.1756034286618; Sun, 24 Aug 2025 04:18:06 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b5753adf7sm66607135e9.7.2025.08.24.04.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Aug 2025 04:18:05 -0700 (PDT) From: =?utf-8?Q?Sergio_Pastor_P=C3=A9rez?= <sergio.pastorperez@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in `vertical-motion' In-Reply-To: <86349ib4yj.fsf@HIDDEN> References: <87ectdt28u.fsf@HIDDEN> <20250819192225.13972-1-sergio.pastorperez@HIDDEN> <87jz2zayfc.fsf@HIDDEN> <86v7mifezm.fsf@HIDDEN> <877byxyg75.fsf@HIDDEN> <86349ib4yj.fsf@HIDDEN> Date: Sun, 24 Aug 2025 13:18:05 +0200 Message-ID: <874itx7ytu.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79241 Cc: 79241 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Eli. I've debugged a bit more this issue, I've found an easy solution (2 lines of code) that solves both issues, reaching the goal column and not skipping lines. I just sent the v2 of the patch. Please take a look! Best regards, Sergio
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.
Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 11:13:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 24 07:13:41 2025
Received: from localhost ([127.0.0.1]:43930 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1uq8fN-0003q5-Eh
for submit <at> debbugs.gnu.org; Sun, 24 Aug 2025 07:13:41 -0400
Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:54365)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.84_2) (envelope-from <sergio.pastorperez@HIDDEN>)
id 1uq8fK-0003pn-CC
for 79241 <at> debbugs.gnu.org; Sun, 24 Aug 2025 07:13:38 -0400
Received: by mail-wr1-x42e.google.com with SMTP id
ffacd0b85a97d-3c6743a10e3so1100606f8f.0
for <79241 <at> debbugs.gnu.org>; Sun, 24 Aug 2025 04:13:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1756034011; x=1756638811; darn=debbugs.gnu.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=LKEhAY9MDDNRPEWTHWTCW61IG1KNWV7nOTS87ReYsBw=;
b=AvwC1Uv/QLWQ0/vNsHiIGOKB346bmThMLSZwylCeCG5PwLsQL2oQByeaOx4lPr+cZ1
qb3+4CWLESRr2kEnQ6q/RDW190FTAP2ijYTCv4Axos6bGgZ+jo8+j4eD/K8e4OF0qodh
cJwTPd8df1YyiOBsg/+RyOyPmnmPK+OeZZX89NgQo4QwFnWWNuIJcQtGvZD1sdPoW2cx
kGL9ycnm5FA7GumnIZiwq4OGrmOBdz9TALpGEd3xwhzfLgs9IRP8zg7yJTCofKtdDRCu
LSzwi8yiUb5ZIHA5RfGsgshZLy6KCGhaPfDWsBPQwqdkPgKMB6ZoPNNkipX+XqBwkDTR
PXEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1756034011; x=1756638811;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=LKEhAY9MDDNRPEWTHWTCW61IG1KNWV7nOTS87ReYsBw=;
b=l/VBouhl+ZMLD5DlUXywwYSXMZ8Xz4jKvOMTDFgE4MbGKqRbVqtX+3JNjbe2DxRAYK
bzUIFGd/Z0o27j3OrR+ek6qrWNSGOcWluK7MXhMJHVyOl0XbxmgkCl6XB8eNbC+PkHqJ
my5nXMz6PyMmSszTcD8p4EyQYVQDAVbUuVFCRLsCP5y891xN/Q3F4LFJ8THonmqU+/OR
Q5FdmPXhWeapX30KNFLaQZVGtYd96T5bPSA56bYqG7emX/wVRga4LHAEynL9Qphdgwp9
bAPYAGIs+57/bYblT7h34P2gdQglM49hFUUtPRqA3rfj68+DrQJpvbJ92VlRWF7ZYVY8
zQeQ==
X-Gm-Message-State: AOJu0YwezxtRLrQrjoFJU9syhszL2VY2FYkVpLe4nxzicQ19tyhNzSso
5+NN6WhyQerTUZfSVf8LltjkEGztBT0q/zuLASCjIRucgplJVUqmJrEVlmazmg==
X-Gm-Gg: ASbGncszhGFEhRCOW0Ala8wEISh0lXIuNoyxoGkZ6oti2cUF4tD3IL1TBW8PN0WT+ed
Jx6izVF/7LGoh+LKi9ixsGyvKzPaXfI00xbvS2X24gtCqUEIl97OvEULiXoUHOd3x1y0rOkiAWm
BGtU+hTUaGhi8osHCaw4xNUUfaDWa4sFM63kI2C1N28KlvJXC0+a7Jga0vqklPveC5YThqrlbuJ
oC08RaX17v6cjdUcSVrLXzQRFHJQfaD4bl/KT4PlZ3QaIqh4dOx3cRD4ht8nW1XqNSu1Ygt24qN
sqnQU0CtxwzMd7wG/oRkiTdmEAujgX3t7lF9pqB6/9wOqY5GP3w1BzSiB6fU0j1JYIqFcscGX2p
Ob0NcO2SW8X7s5yFzxlXFet/YZuIXfJFDvuw0
X-Google-Smtp-Source: AGHT+IGYjV/yhVcBADsgMGHp8pfFt3lrD6xnXSofGrkukTB+h6UtuvtMgKuv1Muh4/jk6VREg1UVmw==
X-Received: by 2002:a05:6000:250e:b0:3b7:8268:8335 with SMTP id
ffacd0b85a97d-3c5dcc0dd86mr6868930f8f.42.1756034010939;
Sun, 24 Aug 2025 04:13:30 -0700 (PDT)
Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67])
by smtp.gmail.com with ESMTPSA id
ffacd0b85a97d-3c70e4b9e2asm7586159f8f.6.2025.08.24.04.13.30
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 24 Aug 2025 04:13:30 -0700 (PDT)
From: =?UTF-8?q?Sergio=20Pastor=20P=C3=A9rez?= <sergio.pastorperez@HIDDEN>
To: 79241 <at> debbugs.gnu.org
Subject: [PATCH v2] Fix incorrect handling of overlays in `vertical-motion'
Date: Sun, 24 Aug 2025 13:13:01 +0200
Message-ID: <20250824111320.10695-1-sergio.pastorperez@HIDDEN>
X-Mailer: git-send-email 2.51.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79241
Cc: =?UTF-8?q?Sergio=20Pastor=20P=C3=A9rez?= <sergio.pastorperez@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
* src/indent.c (vertical-motion): If point is inside an overlay, reset
it to the beginning of line before trying to reach goal column. This
prevents point from being stuck at the beginning of overlay strings
during upward motions.
---
src/indent.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/indent.c b/src/indent.c
index b4f3c349dc5..01865c1494f 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2506,6 +2506,9 @@ line (if such column exists on that line, that is). If the line is
an addition to the hscroll amount. */
if (!NILP (lcols))
{
+ if (it.method == GET_FROM_STRING)
+ reseat_at_previous_visible_line_start(&it);
+
move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
/* If we find ourselves in the middle of an overlay string
which includes a newline after current string position,
--
2.51.0
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.
Received: (at 79241) by debbugs.gnu.org; 23 Aug 2025 12:25:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 23 08:25:29 2025
Received: from localhost ([127.0.0.1]:39001 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1upnJI-0004zB-38
for submit <at> debbugs.gnu.org; Sat, 23 Aug 2025 08:25:28 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43350)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1upnJF-0004yu-83
for 79241 <at> debbugs.gnu.org; Sat, 23 Aug 2025 08:25:26 -0400
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@HIDDEN>)
id 1upnJ9-0008Rf-V8; Sat, 23 Aug 2025 08:25:19 -0400
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=O7pK24K+9e3O02rtEHmM8vYWUWum9KhqAxSZxgIWrlU=; b=FilR3lrstGKXEg2iTj/O
o15h2cvF9sQXa18ExhvNuK8jQN3RbqF4v/Pu7+HO1jUeuD3/pQ6PlJrxFa9o8IQqdHqaTiVh7guMa
1EWKrd9VtPYSRNou123Ku/aS01yBIkwjmxVGBaVFkztTagByB9AiqeyETGIoXXi6Z1HQ+S+6hg7Sm
VhXl6IBOTvmDQeOzftxUT031XnFAORu8jg1j0kxm2H+0cW9xPQlCINCh5EomPyLbP1xCHXt02PlUp
edPqD4fPxQPAztLJZS6Ugmr4SCXDjuGHG1i+BNbNbnIfJKE87wlkvSU/2qdWJi9sr1RerujGr8O12
pWTOMdoycoo/Pg==;
Date: Sat, 23 Aug 2025 15:25:08 +0300
Message-Id: <86349ib4yj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sergio Pastor =?utf-8?Q?P=C3=A9rez?= <sergio.pastorperez@HIDDEN>
In-Reply-To: <877byxyg75.fsf@HIDDEN> (message from Sergio Pastor
=?utf-8?Q?P=C3=A9rez?= on Wed, 20 Aug 2025 20:57:02 +0200)
Subject: Re: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in
`vertical-motion'
References: <87ectdt28u.fsf@HIDDEN>
<20250819192225.13972-1-sergio.pastorperez@HIDDEN>
<87jz2zayfc.fsf@HIDDEN> <86v7mifezm.fsf@HIDDEN> <877byxyg75.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79241
Cc: 79241 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
> From: Sergio Pastor PΓ©rez <sergio.pastorperez@HIDDEN>
> Cc: 79241 <at> debbugs.gnu.org
> Date: Wed, 20 Aug 2025 20:57:02 +0200
>
> Eli Zaretskii <eliz@HIDDEN> writes:
>
> >> > --- a/src/indent.c
> >> > +++ b/src/indent.c
> >> > @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that is). If the line is
> >> > and then reposition point at the requested X coordinate;
> >> > if we don't, the cursor will be placed just after the
> >> > string, which might not be the requested column. */
> >> > - if (nlines >= 0 && it.area == TEXT_AREA)
> >> > + if (nlines != 0 && it.area == TEXT_AREA)
> >> > {
> >> > while (it.method == GET_FROM_STRING
> >> > - && !it.string_from_display_prop_p
> >> > && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it),
> >> > '\n',
> >> > SBYTES (it.string) - IT_STRING_BYTEPOS (it)))
> >> > {
> >> > - move_it_by_lines (&it, 1);
> >> > + int direction = (nlines > 0) ? 1 : -1;
> >> > +
> >> > + move_it_by_lines (&it, direction);
> >> > move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
> >> > }
> >>
> >> I don't know what primitives are available to break this loop once the
> >> target line has been reached, so what seems to happen is that if there
> >> are consecutive lines with multi-line overlays, one after the other,
> >> this while loop keeps going until it reaches the first one of them. This
> >> is only a problem for the upward motion. Since I did not find a
> >> solution, I'm writing this mail in case there is someone more familiar
> >> with the code, that knows how we could detect that the while loop should
> >> finish in this particular case of consecutive lines with multi-line
> >> overlays. In all other cases I've encountered, the patch seems to work
> >> well.
> >
> > What is the "target line" in this case? how is it defined? and why
> > going all the way till the first line of a multi-line overlay is not
> > TRT in this case?
>
> I may have not express myself correctly, I will give you an example to
> clarify what I meant. Let's understand as real lines the ones that are
> numbered, and as visual overlays the others:
> --8<---------------cut here---------------start------------->8---
> 43 QStringList getPlasmaStyles(void);
> βββββββββββββββββββββββββββββββ ccls [2]: unknown type name 'QStringList'
> 44 QStringList getColorSchemes(void);
> βββββββββββββββββββββββββββββββ ccls [2]: unknown type name 'QStringList'
> 45 QStringList getIconThemes(void);
> βββββββββββββββββββββββββββββββ ccls [2]: unknown type name 'QStringList'
> 46 QStringList getCursorThemes(void);
> βββββββββββββββββββββββββββββββ ccls [2]: unknown type name 'QStringList'
> 47 QStringList getGtkThemes(void);
> βββββββββββββββββββββββββββββββ ccls [2]: unknown type name 'QStringList'
> 48 QStringList getKvantumStyles(void);
> βββββββββββββββββββββββββββββββ ccls [2]: unknown type name 'QStringList'
> <|>
> --8<---------------cut here---------------end--------------->8---
>
> In the previous example, `<|>' represents the point.
>
> In this situation, with the patch I provided, issuing
> `(vertical-motion '(4 . -1))' will move the point to column 4 of line
> 43, when the point should land on column 4 of line 48.
If you test the conditions of the while-loop between the call to
move_it_by_lines and the following call to move_it_in_display_line,m
wouldn't you be able to stop at line 48? AFAIU, the overlay string is
placed on the end of the code line whose diagnostic it shows, so the
character at BOL doesn't have the overlay, and you should be able to
break the loop when you want. Or am I missing something?
> To clarify, in my previous message I did not meant that chained
> multi-line overlays should not be skipped, I meant that when there are
> multiple real lines, having multi-line overlays one after the other, the
> point should not go over them. For that, I think we need the while loop
> to stop iterating somehow. We need a way to know if point is outside of
> the overlay and break the loop. If that's not possible, maybe there is a
> way to know if we are already in the target line?
You know when the iterator is outside of the overlay by examining
it.method and the other stuff. A real line will should
GET_FROM_BUFFER there, because what you have at BOL of a real line is
buffer text, not an overlay.
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.
Received: (at 79241) by debbugs.gnu.org; 20 Aug 2025 18:57:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 20 14:57:14 2025
Received: from localhost ([127.0.0.1]:57697 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1uonzm-0008U3-8v
for submit <at> debbugs.gnu.org; Wed, 20 Aug 2025 14:57:14 -0400
Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:59637)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.84_2) (envelope-from <sergio.pastorperez@HIDDEN>)
id 1uonzj-0008Tp-GC
for 79241 <at> debbugs.gnu.org; Wed, 20 Aug 2025 14:57:13 -0400
Received: by mail-wr1-x42a.google.com with SMTP id
ffacd0b85a97d-3b9e41101d4so155179f8f.2
for <79241 <at> debbugs.gnu.org>; Wed, 20 Aug 2025 11:57:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1755716225; x=1756321025; darn=debbugs.gnu.org;
h=content-transfer-encoding:mime-version:message-id:date:references
:in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
:reply-to; bh=sBk05CzvvDeh1xPGkUMnb9QduHWL6K6lGRxaM89Dl3M=;
b=Q+V6uF7WuL0oNv55ks0HqKAIVMtLMTCcHL/fB5KNgjzgvUAUjE0WsH4N81SfIDbOig
4DHCfxOalR06JoUvj1CC5MLpIgolhuE1+YrAxxonLkLKWGZribK4zKLsQMucaeUV/keF
Qc6RPzPK6Xq6ReMqlQC7c3giWARwlbuTNaecYgley+I178bITKmUaneo+nXSCab3gswm
1W+miJEefC0o6Mg1gcRgE2WFsR/GuZZyV+VHJv5N2sPU9a4VzFsqO3pt11yokOP+tl98
4y6cW/QKwL1b50RFF84vSb+WDLcm4AWzsNe4JlUs2SIoHxXwgOTDojkvNwr8qSd+r3xx
i8/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1755716225; x=1756321025;
h=content-transfer-encoding:mime-version:message-id:date:references
:in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=sBk05CzvvDeh1xPGkUMnb9QduHWL6K6lGRxaM89Dl3M=;
b=m1uenYdBmaDuMiztyHZeXP6yakqkvNYpN8p0+8PumDe+6RMwAevhLNR98fmrWiPeXd
e4uPV1DEztM3xN0+/bZp3/PFx3RIKONDLv5g4NLxlbp3HyYG63VqduoddolUth2Q/lT3
vUBMf9AU7dcQTStXzi1D6tmF/5oIAottfF8hvUW2MJ9RMG15GD4zDdgQF3kWnvq0bAZT
fOZ2/vNB/f+XAVabLV6/8YAkPkQfQTRnbAHQ71udH4oD37PP12Z+dhLyTK71dZO0d1UT
rcqMlGmS4HfFK7/oUaBqAVoZvpWnQT3T+VjJYbNBahR6yJrdCQgY2FlSjgx0iIDA12/F
ez1A==
X-Gm-Message-State: AOJu0YzTzCCx7iKHS9iPv9ZNFAdIZY2zFebdz0klI0SWO9C3Hz0/86fM
hnRmHDLEIcNUTEpwSmtUrgIi4ZS5WaDVtz8AIolnvi1P4xQ+T4MrL9ng
X-Gm-Gg: ASbGncsoYMb8l0fhWz4HZtW4g0QADlQEl7POMc6D6CnzWmZftzWocMpw2MkzxHoO+dh
uu2c9Jg5J18qCEAk3tCmrdSW4j5wJ8gVknx8SsizxgCIC0wwTOWiwvSKBe1Ga7UF0npdFCo0UcH
yamOK+7p8cgPYKX/QILiHNAzC2z7gM2BvP+NQ2hgmoGqWPhfUrFRSr9PpawAEm06Td68A+mH0Yy
qzGd7R5qZ36SQBrwF190vEdGTYt/5adACGUu+bEGZ/mZYyJ+6hTFOVI2Y56ygyImBrIMnOrt2tA
gCrx14vHQIcbq2DvZKL5SWYKyxDlYsKeFvvGF9Sv4ZAPaXMn19+pBnUKC7Qq+eE7fjHGwWQQ9Bi
71z6DOuA6OVoLhMCneFnOtY2m6MDU
X-Google-Smtp-Source: AGHT+IFeUBWuU1dJ+RaHksmKzumNA+sLFU3Iqdz2EQvkKJpOKvHTr+ZnnhU7mhGrTjUs5Vri+ddOaQ==
X-Received: by 2002:a05:6000:2c07:b0:3c3:a80d:2bbd with SMTP id
ffacd0b85a97d-3c3a80d30cemr2048225f8f.58.1755716225025;
Wed, 20 Aug 2025 11:57:05 -0700 (PDT)
Received: from localhost ([79.117.89.92]) by smtp.gmail.com with ESMTPSA id
ffacd0b85a97d-3c077789c2asm9195479f8f.57.2025.08.20.11.57.03
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 20 Aug 2025 11:57:04 -0700 (PDT)
From: Sergio Pastor =?utf-8?Q?P=C3=A9rez?= <sergio.pastorperez@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in
`vertical-motion'
In-Reply-To: <86v7mifezm.fsf@HIDDEN>
References: <87ectdt28u.fsf@HIDDEN>
<20250819192225.13972-1-sergio.pastorperez@HIDDEN>
<87jz2zayfc.fsf@HIDDEN> <86v7mifezm.fsf@HIDDEN>
Date: Wed, 20 Aug 2025 20:57:02 +0200
Message-ID: <877byxyg75.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79241
Cc: 79241 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Eli Zaretskii <eliz@HIDDEN> writes:
>> > --- a/src/indent.c
>> > +++ b/src/indent.c
>> > @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that=
is). If the line is
>> > and then reposition point at the requested X coordinate;
>> > if we don't, the cursor will be placed just after the
>> > string, which might not be the requested column. */
>> > - if (nlines >=3D 0 && it.area =3D=3D TEXT_AREA)
>> > + if (nlines !=3D 0 && it.area =3D=3D TEXT_AREA)
>> > {
>> > while (it.method =3D=3D GET_FROM_STRING
>> > - && !it.string_from_display_prop_p
>> > && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it),
>> > '\n',
>> > SBYTES (it.string) - IT_STRING_BYTEPOS (it)))
>> > {
>> > - move_it_by_lines (&it, 1);
>> > + int direction =3D (nlines > 0) ? 1 : -1;
>> > +
>> > + move_it_by_lines (&it, direction);
>> > move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
>> > }
>>=20
>> I don't know what primitives are available to break this loop once the
>> target line has been reached, so what seems to happen is that if there
>> are consecutive lines with multi-line overlays, one after the other,
>> this while loop keeps going until it reaches the first one of them. This
>> is only a problem for the upward motion. Since I did not find a
>> solution, I'm writing this mail in case there is someone more familiar
>> with the code, that knows how we could detect that the while loop should
>> finish in this particular case of consecutive lines with multi-line
>> overlays. In all other cases I've encountered, the patch seems to work
>> well.
>
> What is the "target line" in this case? how is it defined? and why
> going all the way till the first line of a multi-line overlay is not
> TRT in this case?
I may have not express myself correctly, I will give you an example to
clarify what I meant. Let's understand as real lines the ones that are
numbered, and as visual overlays the others:
--8<---------------cut here---------------start------------->8---
43 QStringList getPlasmaStyles(void);
=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn=
own type name 'QStringList'
44 QStringList getColorSchemes(void);
=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn=
own type name 'QStringList'
45 QStringList getIconThemes(void);
=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn=
own type name 'QStringList'
46 QStringList getCursorThemes(void);
=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn=
own type name 'QStringList'
47 QStringList getGtkThemes(void);
=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn=
own type name 'QStringList'
48 QStringList getKvantumStyles(void);
=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn=
own type name 'QStringList'
<|>
--8<---------------cut here---------------end--------------->8---
In the previous example, `<|>' represents the point.
In this situation, with the patch I provided, issuing
`(vertical-motion '(4 . -1))' will move the point to column 4 of line
43, when the point should land on column 4 of line 48.
To clarify, in my previous message I did not meant that chained
multi-line overlays should not be skipped, I meant that when there are
multiple real lines, having multi-line overlays one after the other, the
point should not go over them. For that, I think we need the while loop
to stop iterating somehow. We need a way to know if point is outside of
the overlay and break the loop. If that's not possible, maybe there is a
way to know if we are already in the target line?
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.
Received: (at 79241) by debbugs.gnu.org; 20 Aug 2025 10:46:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 20 06:46:01 2025
Received: from localhost ([127.0.0.1]:56205 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1uogKO-0003ZV-Up
for submit <at> debbugs.gnu.org; Wed, 20 Aug 2025 06:46:01 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:39190)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uogKK-0003Z6-G8
for 79241 <at> debbugs.gnu.org; Wed, 20 Aug 2025 06:45:58 -0400
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@HIDDEN>)
id 1uogKF-0004F4-2C; Wed, 20 Aug 2025 06:45:51 -0400
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=VcK2GXBt0iVr6ON5zo+h+AOab58sVjoaCKavYPCkO6c=; b=ohK3UfV7pwNEuCdpI5KX
T20pCv2v+Jbc0AD7o1DmHpk96gxiIq0ULeAwTw7EN3RLG2Fz/Air6dIH+u3eYNTR0vipgas3LIune
1zUn9QzFtWaMjUZYAwYgb5uP5rmX1W3BTOMn0j11GceyQXNeoB9dhz1tiF2/93XrKk67ynQJTKnw2
xHnKLq2V2JbiaUK4JcVjU16OaJ9OMYD2Y3cHRP/p6Hva4yFGTSPStJjseLPwVxo+NEQJwQYMXbWXc
1uRao/OrOLclPfz2WjWOvLTQtlTIO4LfO8L4pht811TAilKUGb/Q+o6aJt7bRXsQ/CkSugD05DEE8
ACWd8l9ClnGkiw==;
Date: Wed, 20 Aug 2025 13:45:49 +0300
Message-Id: <86v7mifezm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sergio Pastor =?utf-8?Q?P=C3=A9rez?= <sergio.pastorperez@HIDDEN>
In-Reply-To: <87jz2zayfc.fsf@HIDDEN> (message from Sergio Pastor
=?utf-8?Q?P=C3=A9rez?= on Tue, 19 Aug 2025 21:44:55 +0200)
Subject: Re: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in
`vertical-motion'
References: <87ectdt28u.fsf@HIDDEN>
<20250819192225.13972-1-sergio.pastorperez@HIDDEN>
<87jz2zayfc.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79241
Cc: 79241 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
> From: Sergio Pastor PΓ©rez <sergio.pastorperez@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>
> Date: Tue, 19 Aug 2025 21:44:55 +0200
>
> I've debugged the `vertical-motion' procedure and found the troublesome
> code. This patch solves the issue with the goal column, but it has 1
> corner case to that I don't know how to solve.
Thanks for working on this.
> > --- a/src/indent.c
> > +++ b/src/indent.c
> > @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that is). If the line is
> > and then reposition point at the requested X coordinate;
> > if we don't, the cursor will be placed just after the
> > string, which might not be the requested column. */
> > - if (nlines >= 0 && it.area == TEXT_AREA)
> > + if (nlines != 0 && it.area == TEXT_AREA)
> > {
> > while (it.method == GET_FROM_STRING
> > - && !it.string_from_display_prop_p
> > && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it),
> > '\n',
> > SBYTES (it.string) - IT_STRING_BYTEPOS (it)))
> > {
> > - move_it_by_lines (&it, 1);
> > + int direction = (nlines > 0) ? 1 : -1;
> > +
> > + move_it_by_lines (&it, direction);
> > move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
> > }
>
> I don't know what primitives are available to break this loop once the
> target line has been reached, so what seems to happen is that if there
> are consecutive lines with multi-line overlays, one after the other,
> this while loop keeps going until it reaches the first one of them. This
> is only a problem for the upward motion. Since I did not find a
> solution, I'm writing this mail in case there is someone more familiar
> with the code, that knows how we could detect that the while loop should
> finish in this particular case of consecutive lines with multi-line
> overlays. In all other cases I've encountered, the patch seems to work
> well.
What is the "target line" in this case? how is it defined? and why
going all the way till the first line of a multi-line overlay is not
TRT in this case?
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.
Received: (at 79241) by debbugs.gnu.org; 19 Aug 2025 19:45:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 19 15:45:09 2025
Received: from localhost ([127.0.0.1]:54971 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1uoSGb-00022A-C1
for submit <at> debbugs.gnu.org; Tue, 19 Aug 2025 15:45:09 -0400
Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:58867)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.84_2) (envelope-from <sergio.pastorperez@HIDDEN>)
id 1uoSGZ-0001wi-1X
for 79241 <at> debbugs.gnu.org; Tue, 19 Aug 2025 15:45:08 -0400
Received: by mail-wm1-x32e.google.com with SMTP id
5b1f17b1804b1-45a1b05fe23so35393935e9.1
for <79241 <at> debbugs.gnu.org>; Tue, 19 Aug 2025 12:45:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1755632700; x=1756237500; darn=debbugs.gnu.org;
h=content-transfer-encoding:mime-version:user-agent:message-id:date
:references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to;
bh=z+5alLghp8Xx7ljtqhL7a646I77+CXER36zk3s05dmo=;
b=XqaCbh1x+igmVrhUYxXe4nH+ruCCpjbC54eXNVyZC9OOsttu87A7TppR9zejMRpial
6G0U1jLD9LAfkC3gRcpHJmbfRpxz2mCuN7FSJJs59yjj3VTuJbJLN9G5CJW3xl+NwuJp
A36YzeQkT7e4Vprt4Mbn22OPFqg+AznQqeqHVpC/02lrTyaNld/x/hF/PiZzIfTsTj6v
yeKO6YV4Y7Li5xnqp8ZUIii0D12dxLpOnPg5M0kjwqXXLznoYwJqpwBZB4JlO01+e8Ks
SPlV63Lx4EBvnWgnFGDH3mkc1CSeWTnL3jZCGDcU3UOgtNwDUzy6yPnxqxOme6ZjG9o/
Uu5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1755632700; x=1756237500;
h=content-transfer-encoding:mime-version:user-agent:message-id:date
:references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to;
bh=z+5alLghp8Xx7ljtqhL7a646I77+CXER36zk3s05dmo=;
b=gL28gnbK2s9OehpRrX1UXkoCCRO3KZ0R2mapmMvIdqN4QzJlNuxhIF2Rp4jyL6DIFW
Xl61chSb9qapzPEH9SJkwCun6OnIw2gjjD2EV1mgS+8TSwiSqcGUpErt2fd+227YC0sn
O6OvW4d0TqRFQkdfEWn/j4O1q8QqSM0HxfNyC/JifVOjE546olAPWwl41/KcL8vbGsQP
4gw8Pug9i9TQCIjRuBg0ds80I9a/DHc2z8XMsPvgumlx+mBWjCw28M9TZgclq2HBXjr8
k3NZSsLWzGfxCqdISCXQc31Y/mewe0jLFtCtn5PdLxuuEjmSxgr/O+1ba5eOmxyGFHIC
Uqwg==
X-Gm-Message-State: AOJu0Yyyxi8X5hz5+5fENYuM0fKQq6yhiYg5zsp++EnivV8lwuBdNdJb
b6u6da9u2KTxwBUKo5uakiQLNyzieyWlh5ldg2VR1qf/ZXguSHwwZCKg+/wg1Q==
X-Gm-Gg: ASbGnctht6r13AyX9NxEmwJb7FdnbVRBPfUKgaT0uaY8ljv0Bn3KdMbMpUzH//iSO12
W2PfJq9jdNgl05K9kLgRmyGCmDx2KIy3xqW5LuKB+qq0y/ELQJFR6m+/mGSa2bFPqpBDHmg3IGI
aDP4eflfz7Fcfh5KhFfOYevLnFS/yjxuCf75KsmKl7dikD/JoR4G1PGRkTGgtOc4160SeSg9C0w
LMpfQ4zLuHT3GtGTK8k5wbZDyQIrPNdJ7aXkjMuEZ7U3UUvPvbbYivJr2dh5Ijrfpfj3lvkV74C
WLYc+CMBKtCozCVQMz3pQtoFKHrxQy+t6dATAm3gbmkcajG7aX3QzsVM2aZkPROaHyiH2p5vARj
9Q9zylKKJr6b4LgALeD3viPLfoOkw
X-Google-Smtp-Source: AGHT+IHhjvuDBXRednxGyQjgRZxLuM1BMXyhrSxLXjI63AGrq0Ki3r23qrdvEj35hjZthG+Or3Ib6g==
X-Received: by 2002:a05:6000:22c6:b0:3b9:1636:c443 with SMTP id
ffacd0b85a97d-3c32ebd9526mr159191f8f.52.1755632699949;
Tue, 19 Aug 2025 12:44:59 -0700 (PDT)
Received: from localhost ([79.117.89.92]) by smtp.gmail.com with ESMTPSA id
ffacd0b85a97d-3c07778939bsm4593471f8f.46.2025.08.19.12.44.58
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 19 Aug 2025 12:44:59 -0700 (PDT)
From: =?utf-8?Q?Sergio_Pastor_P=C3=A9rez?= <sergio.pastorperez@HIDDEN>
To: 79241 <at> debbugs.gnu.org
Subject: Re: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in
`vertical-motion'
In-Reply-To: <20250819192225.13972-1-sergio.pastorperez@HIDDEN>
References: <87ectdt28u.fsf@HIDDEN>
<20250819192225.13972-1-sergio.pastorperez@HIDDEN>
Date: Tue, 19 Aug 2025 21:44:55 +0200
Message-ID: <87jz2zayfc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79241
Cc: Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Hello!
I've debugged the `vertical-motion' procedure and found the troublesome
code. This patch solves the issue with the goal column, but it has 1
corner case to that I don't know how to solve.
Sergio Pastor P=C3=A9rez <sergio.pastorperez@HIDDEN> writes:
> FIXME: if multiple lines with multi-line overlays are present, going
> upwards jumps to the first one of them, instead of the previous line at
> the right column.
>
> * src/indent.c (vertical-motion): Ensure multi-line overlay handling
> logic captures upward motions.
> ---
> src/indent.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/indent.c b/src/indent.c
> index b4f3c349dc5..c1c32824dad 100644
> --- a/src/indent.c
> +++ b/src/indent.c
> @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that is=
). If the line is
> and then reposition point at the requested X coordinate;
> if we don't, the cursor will be placed just after the
> string, which might not be the requested column. */
> - if (nlines >=3D 0 && it.area =3D=3D TEXT_AREA)
> + if (nlines !=3D 0 && it.area =3D=3D TEXT_AREA)
> {
> while (it.method =3D=3D GET_FROM_STRING
> - && !it.string_from_display_prop_p
> && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it),
> '\n',
> SBYTES (it.string) - IT_STRING_BYTEPOS (it)))
> {
> - move_it_by_lines (&it, 1);
> + int direction =3D (nlines > 0) ? 1 : -1;
> +
> + move_it_by_lines (&it, direction);
> move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
> }
I don't know what primitives are available to break this loop once the
target line has been reached, so what seems to happen is that if there
are consecutive lines with multi-line overlays, one after the other,
this while loop keeps going until it reaches the first one of them. This
is only a problem for the upward motion. Since I did not find a
solution, I'm writing this mail in case there is someone more familiar
with the code, that knows how we could detect that the while loop should
finish in this particular case of consecutive lines with multi-line
overlays. In all other cases I've encountered, the patch seems to work
well.
> }
Best regards,
Sergio
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.
Received: (at 79241) by debbugs.gnu.org; 19 Aug 2025 19:23:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 19 15:23:03 2025
Received: from localhost ([127.0.0.1]:54927 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1uoRvC-0000xv-Mu
for submit <at> debbugs.gnu.org; Tue, 19 Aug 2025 15:23:03 -0400
Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:50515)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.84_2) (envelope-from <sergio.pastorperez@HIDDEN>)
id 1uoRv9-0000xM-Ii
for 79241 <at> debbugs.gnu.org; Tue, 19 Aug 2025 15:23:01 -0400
Received: by mail-wr1-x432.google.com with SMTP id
ffacd0b85a97d-3b9dc5c2f0eso3628862f8f.1
for <79241 <at> debbugs.gnu.org>; Tue, 19 Aug 2025 12:22:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1755631372; x=1756236172; darn=debbugs.gnu.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=Ng52ypwEKPtxvzFeL6Iu/y4dPoz0xwnELldXbfNIoCM=;
b=cUKxgvWQM2J4uvADkCvQHe5GY/S/bs31mGKNNoWHhNJWQ0SC9Ozq5dNL9s9O1gfAwG
L4BvRgOKdxV7GJKyMf3yWo9kYbKznFHikiLsVxVZbqQRmm9+9+cXeQHaOihG/Bb4LddS
kxrm12cDLrWusCI5jnOhNs3FXYwJ23L1msOg3nLpTbn/Cp4xfnSnZmMkjYGmqV61GOgP
K5e0aOhb0iBDegiK7+nh7BANDQfqdxbxQDPk3QoO0wSccvS2Al7RxNyo0LSQHUZY+8LM
JIDO5uMsyV/yvGDRlwqopmoKHcZj4SYEfXpWpn0luj4jGnfwT/p5Gah9iEPz/nyCcyD9
Ce7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1755631372; x=1756236172;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=Ng52ypwEKPtxvzFeL6Iu/y4dPoz0xwnELldXbfNIoCM=;
b=TIDXWdBw0o/Z9p4qSnrk4knhZ9CUr8P+q49CU6hCUNCh01skDSpH6Y8wXEP0XAlCB+
WEsbQioa95aT46EpZLpkRBD/FAJZw4fwybViVMN3PCGSAGA0jOemdjGQs1fm7pdGnF3+
Qi+gO4ZPY9rnc91KF8u6rHPHHt7B2TbgEwG46yu3In8T/BV96uJyNbTiOwkpqtxMByy8
v7TV/AntpUn7b9TOUuJX978lWOJvzUlFutLlvcuQsleaxdwI5GvkDk3H2wa2t4NVz9lW
11su1YHYqJEV/0DQCHFZWkMjMcLtl5QG7W6nK3pptQfpRZYNmRwA4rpI2/AO9KiJESF7
3MHA==
X-Gm-Message-State: AOJu0YwriuTEI4+x7D8diD5Uzjk3wbSibIs30dTbmIV/s5LZI0k1ybM1
3NO03zQzMU8voVWf2J6WdvmCoShuXh2dCVqSOQxsHzGiRTP8/sgMrUb+RC21zw==
X-Gm-Gg: ASbGnct3nH3MW2D91C6XW19sJc86a/4g2XcvKdI15c5ceA59gtRNckU5WfOUVRccR4+
XdvfEUj1nfewYvmnrKra0eWw9Aq++32b8KUB4mNpWRXbT8qKqNlWC8YU45o1QM1w62nBZzgDdR+
svKfT9aDX/OiRbyL8rLg+HrtE5rZoL7o0HPrc99kpT9XFQHnZ9wKu+5B94GJ/qfsIB3m2WHMyKb
+s2VYjKARwIeIg21IT3rXoiUYFQ4D0TIFNjARatN5ktHrhB6jxn65BNERqA6+U4m2M3Ik3cB7dy
K3IZc8nTZJ1XksdSsc4JuX6YnEYdV+JwqCP9R2UuBWVZV/h74ug2EXot1DffbHuont6o56jVc4H
S9hLW0RE0CEbqdoGjQ6scWMBHGjh2
X-Google-Smtp-Source: AGHT+IH1O4QosyEbjvhmfaCDVS5OG130YwkmRwTQORT3KFt8/+SY/g9ucAt3vpBRQQMeaAw6+xNkWw==
X-Received: by 2002:a05:6000:188f:b0:3b6:d95:a3a4 with SMTP id
ffacd0b85a97d-3c32bf5ceaamr86792f8f.4.1755631372333;
Tue, 19 Aug 2025 12:22:52 -0700 (PDT)
Received: from localhost ([79.117.85.92]) by smtp.gmail.com with ESMTPSA id
5b1f17b1804b1-45b42a6d7b7sm53933835e9.1.2025.08.19.12.22.51
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 19 Aug 2025 12:22:51 -0700 (PDT)
From: =?UTF-8?q?Sergio=20Pastor=20P=C3=A9rez?= <sergio.pastorperez@HIDDEN>
To: 79241 <at> debbugs.gnu.org
Subject: [PATCH] WIP: Fix incorrect handling of overlays in `vertical-motion'
Date: Tue, 19 Aug 2025 21:21:58 +0200
Message-ID: <20250819192225.13972-1-sergio.pastorperez@HIDDEN>
X-Mailer: git-send-email 2.50.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79241
Cc: =?UTF-8?q?Sergio=20Pastor=20P=C3=A9rez?= <sergio.pastorperez@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
FIXME: if multiple lines with multi-line overlays are present, going
upwards jumps to the first one of them, instead of the previous line at
the right column.
* src/indent.c (vertical-motion): Ensure multi-line overlay handling
logic captures upward motions.
---
src/indent.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/indent.c b/src/indent.c
index b4f3c349dc5..c1c32824dad 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2513,15 +2513,16 @@ line (if such column exists on that line, that is). If the line is
and then reposition point at the requested X coordinate;
if we don't, the cursor will be placed just after the
string, which might not be the requested column. */
- if (nlines >= 0 && it.area == TEXT_AREA)
+ if (nlines != 0 && it.area == TEXT_AREA)
{
while (it.method == GET_FROM_STRING
- && !it.string_from_display_prop_p
&& memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it),
'\n',
SBYTES (it.string) - IT_STRING_BYTEPOS (it)))
{
- move_it_by_lines (&it, 1);
+ int direction = (nlines > 0) ? 1 : -1;
+
+ move_it_by_lines (&it, direction);
move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
}
}
--
2.50.1
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.Eli Zaretskii <eliz@HIDDEN>
to control <at> debbugs.gnu.org.
Full text available.Received: (at 79241) by debbugs.gnu.org; 16 Aug 2025 06:51:27 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 16 02:51:27 2025 Received: from localhost ([127.0.0.1]:40584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1unAlD-0000q3-6i for submit <at> debbugs.gnu.org; Sat, 16 Aug 2025 02:51:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42678) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1unAlA-0000ph-ES; Sat, 16 Aug 2025 02:51:25 -0400 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@HIDDEN>) id 1unAl5-0005Rj-15; Sat, 16 Aug 2025 02:51:19 -0400 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=l9cbrEwLfjDLv1Vn/EZUcZhlyR3nNTACR12qvaPWc74=; b=PHAH1skPwcIoWcdguopu 4ZxSclb/nFnqinUNSw4G9lRzrMNToo5v1msxQ5b3ysvz1WZRfcZ/egUmVDSzyy9ITY+Yj0upSmIHt jOCCquJnyJ8ZJflVIdMYIKGznOsW1F/AlclpFVqomVPK8BMVHhX3zhcsJ/G4q/5G+xt6QWD+4cVVB DECs7NsDvHzhROYYNnyzJwhHnYyKgpXE4IXwNYXw8ab+qBuEM+WhWf6aMKo3ROZ82y0cFgQVV3lwp hvtBaITmY9C/Ah/1RlDNfIzKcEFbysNc57a0VDZ5uGT3mKhfHp5drv7QyyaMnzxX2DfmBLkstsDxG aamk4FlVV7a6Tg==; Date: Sat, 16 Aug 2025 09:50:57 +0300 Message-Id: <86ikinlpym.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Sergio Pastor =?iso-8859-1?Q?P=E9rez?= <sergio.pastorperez@HIDDEN> In-Reply-To: <87ectdt28u.fsf@HIDDEN> (message from Sergio Pastor =?iso-8859-1?Q?P=E9rez?= on Fri, 15 Aug 2025 10:31:29 +0200) Subject: Re: bug#79241: 31.0.50; `vertical-motion' not respecting goal column when there is an overlay that spans multiple virtual lines References: <87ectdt28u.fsf@HIDDEN> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79241 Cc: 79241 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) severity 79241 minor thanks > From: Sergio Pastor Pιrez <sergio.pastorperez@HIDDEN> > Date: Fri, 15 Aug 2025 10:31:29 +0200 > > The issue is that `vertical-motion' does not seem to respect goal column > when moving upwards through an overlay that spans multiple visual lines. > > I will give a recipe using the latest version of Flymake, since it's an > easy way to generate an overlay that spawns multiple visual lines, but I > suspect that this issue can be reproduced with any overlay of those > characteristics, and is not a particual issue of Flymake. I've tried to > debug the line movement code but at some point I reached > `vertical-motion', which is a C function, so I didn't debug it further. > Invoking: `(vertical-motion '(0.0 . -1))' is enough to see the behavior > described. > > 1) Install Flymake v1.4.1. (I used Elpaca) > 2) `(setq flymake-show-diagnostics-at-end-of-line 'fancy)` > 3) Go to a buffer where diagnostic will show, I used Eglot for this. > 4) Put the cursor a the beginning of the line prior to the overlay > generated by Flymake. Notice that when using the `'fancy' setting, the > message will span across multiple visual lines. > 5) Try to move upwards, towards the diagnostic. We expect the cursor to > remain at the beggining of the line but instead, it goes to the end of > the line. This behavior does not happen when moving downwards through > the diagnostic message. Thanks. The "beginning of the line" where the Flymake diagnostic is displayed doesn't really exist in the buffer. If you place point at the end of the code line for which Flymake shows a diagnostic and then press C-f, the cursor will jump over all the diagnostic string and land at the beginning of the _following_ line. This is expected, because Emacs cannot place the cursor inside an overlay, not really. Flymake attempts to "fix" that by having the 'cursor' property on the overlay's string, but that only works up to a point. Overlay strings like this with embedded newlines cause a lot of complexity and grief in vertical-motion's implementation, so I'm not surprised that it behaves a bit strangely in this case. The basic requirement from vertical-motion in these cases is not to get stuck around such lines, so that C-n and C-p work reasonably well and allow movement through the buffer, and that does work in this case. So from where I stand, this is a very minor annoyance, nothing more. If someone wants to work on improving the behavior of vertical-motion in these cases, and they do a clean job, such changes will be very welcome, but failing that, I think the current behavior is far from a catastrophe that needs immediate attention.
bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.Received: (at submit) by debbugs.gnu.org; 15 Aug 2025 08:32:33 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 15 04:32:32 2025 Received: from localhost ([127.0.0.1]:37224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1umprU-00072f-6b for submit <at> debbugs.gnu.org; Fri, 15 Aug 2025 04:32:32 -0400 Received: from lists.gnu.org ([2001:470:142::17]:56364) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <sergio.pastorperez@HIDDEN>) id 1umprR-00072P-73 for submit <at> debbugs.gnu.org; Fri, 15 Aug 2025 04:32:30 -0400 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 <sergio.pastorperez@HIDDEN>) id 1umprL-0006ed-NQ for bug-gnu-emacs@HIDDEN; Fri, 15 Aug 2025 04:32:23 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <sergio.pastorperez@HIDDEN>) id 1umprI-0002x1-JO for bug-gnu-emacs@HIDDEN; Fri, 15 Aug 2025 04:32:22 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-45a1b0b6ac4so8693585e9.2 for <bug-gnu-emacs@HIDDEN>; Fri, 15 Aug 2025 01:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755246738; x=1755851538; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=/0BSePzqbnpMCJZkbZOADqBmkm0eXaXSFvm28MwblrI=; b=kXEA1AinS7XFuEsx/oeoM7JvCqs882QydfO6EJk9/CqxeU8WsThgVu92UXhur63xrJ eNU0YcFNLeSqCz5i1eiYLa36DwsFdbfiiPicmKhc/U3JPdVFSuROJUu1v2t3eE8iAcLs ghQS9JZHGIDoxjnVJqDXE9TnuuR628j9NE6pg7p2XlCQEB6gL41BaZUrGQhZk2sIpyDr 5ypqFrIituN/thBWAjpQEGS71VMWZ5TBQjOqJ2rBDal9SJ3dIqjRJKEc/1bezFT19ln/ 5nH52U2BupHZ0+aKrPCD3fZKyTeZrnI+/Qyjz2E/61tavQDWNsRNbkob/wdwlBAn7XOc x6Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755246738; x=1755851538; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/0BSePzqbnpMCJZkbZOADqBmkm0eXaXSFvm28MwblrI=; b=NlOFVG/UpJHoY+ioqBmUKAGh7S23oUCnThjmhQwFLsfVjOKh7sRgyUxJc0Kcmn4HjE vkPinqWnaUD/fq47hKA1s8eN/l64K5l8gIcsfheiBh1Sa6Mxf+9rlJjAmFvrFrAszMPk FT2n3f6sntMGDS833md/3BguhA8tK7LldbdJ7JHT8oL3ezJZjXOe/NkTr9DDNtlcqqZ5 be6JSHk+ns8UMZ+p/xQZMaWN3NBtOzFV7CydAYDw/E5aAGN3//FzYNsNg8zR0MLPxXHW fZl2KpDsbN1ymc9OkjsIH8oDE/Zx1BpDbSt3IffFmld2YSOFroo+ciUAtxfUBW8EBWIY OmxQ== X-Gm-Message-State: AOJu0YzEXGmhIgkG1ehPcp3XYNe9MaSuDidD2XucX1BYpDvka7kpEOyS c4B5IvQ1qcYoxW5fIJ9aMm0rN8Cz3o+813CAG55RAyq1oHTz/ITfBu6vcOQMoQ== X-Gm-Gg: ASbGncvMOn7JBbw5jWvrBgPKJnQuiI+tSnWwa8Pogkjd9pNs3Y8hvlZWs47ZgDLfC2X 1AvUkIbHJ60mKV97wARdY2EPPtkePDw/kfd5yHdVwrxIjtB7Zo7DOrFTQTOIPD9W3JoC2SfketW klVPGBix9joUPDtetPvKBFcXr/p4lSOipXcAVYGwJ2nFPtND/W+i3SZD+W8we420Z0qcP75qPdH lTEYxVUxSJqInsHlXvB7uYH0ihSRfWe4GkW33hSJ7rTbXBomIc64zt2gKWHrbyzGiywac4Ncmbr iTIdBSzsPN8OT9uYdQjoGB16N0uFmVji74ds4xyGK2iwKRd8/R9yv52LOY7JQQP5WjX0tWczEQ4 H8cnlTc4F9Wg7GZ86bJMHXrckOY4TS1UVxZ6RNp51DVDRwSc= X-Google-Smtp-Source: AGHT+IFvRtHuu5COakMVsEZu0G1lkRw7AcCiWjTA26bhRY/Co0dz/xD94xe9La104vMXw0/bQgva+A== X-Received: by 2002:a05:600c:4746:b0:456:2212:46b8 with SMTP id 5b1f17b1804b1-45a21868a75mr8136415e9.28.1755246737196; Fri, 15 Aug 2025 01:32:17 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a233257b7sm4573415e9.3.2025.08.15.01.32.16 for <bug-gnu-emacs@HIDDEN> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 01:32:16 -0700 (PDT) From: =?utf-8?Q?Sergio_Pastor_P=C3=A9rez?= <sergio.pastorperez@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: 31.0.50; `vertical-motion' not respecting goal column when there is an overlay that spans multiple virtual lines Date: Fri, 15 Aug 2025 10:31:29 +0200 Message-ID: <87ectdt28u.fsf@HIDDEN> X-Debbugs-Cc: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=sergio.pastorperez@HIDDEN; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) The issue is that `vertical-motion' does not seem to respect goal column when moving upwards through an overlay that spans multiple visual lines. I will give a recipe using the latest version of Flymake, since it's an easy way to generate an overlay that spawns multiple visual lines, but I suspect that this issue can be reproduced with any overlay of those characteristics, and is not a particual issue of Flymake. I've tried to debug the line movement code but at some point I reached `vertical-motion', which is a C function, so I didn't debug it further. Invoking: `(vertical-motion '(0.0 . -1))' is enough to see the behavior described. 1) Install Flymake v1.4.1. (I used Elpaca) 2) `(setq flymake-show-diagnostics-at-end-of-line 'fancy)` 3) Go to a buffer where diagnostic will show, I used Eglot for this. 4) Put the cursor a the beginning of the line prior to the overlay generated by Flymake. Notice that when using the `'fancy' setting, the message will span across multiple visual lines. 5) Try to move upwards, towards the diagnostic. We expect the cursor to remain at the beggining of the line but instead, it goes to the end of the line. This behavior does not happen when moving downwards through the diagnostic message. The issue is that `vertical-motion' does not seem to respect goal column when moving upwards through an overlay that spans multiple visual lines. I will give a recipe using the latest version of Flymake, since it's an easy way to generate an overlay that spawns multiple visual lines, but I suspect that this issue can be reproduced with any overlay of those characteristics and is not a particular issue of Flymake. I've tried to debug the line movement code but at some point I reached `vertical-motion' which is a C function so I cannot debug it further. Invoking: `(vertical-motion '(0.0 . -1))' is enough to see the behavior described. 1) Install Flymake v1.4.1. (I used Elpaca) 2) `(setq flymake-show-diagnostics-at-end-of-line 'fancy)` 3) Go to a buffer where diagnostic will show, I used Eglot for this. 4) Put the cursor a the beginning of the line prior to the overlay generated by Flymake. Notice that when using the `'fancy' setting, the message will span across multiple visual lines. 5) Try to move upwords, towards the diagnostic. We expect the cursor to remain at the beginning of the line but instead, it goes to the end of the line. This behavior does not happen when moving downwards through the diagnostic message. In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.4) System Description: Guix System Configured using: 'configure CONFIG_SHELL=/gnu/store/nnx8iifrj6jfih4sivivq17cf65aa968-bash-minimal-5.2.37/bin/bash SHELL=/gnu/store/nnx8iifrj6jfih4sivivq17cf65aa968-bash-minimal-5.2.37/bin/bash --prefix=/gnu/store/g1rsgv58jnqpy6q2rnhy7xzqvpjks2f4-emacs-next-pgtk-31.0.50-1.9663c95 --enable-fast-install --with-pgtk --with-cairo --with-modules --with-native-compilation=aot 'CFLAGS=-g -O2 -Wno-error=incompatible-pointer-types' --disable-build-details' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $EMACSLOADPATH: /home/pastor/.guix-home/profile/share/emacs/site-lisp:/home/pastor/.guix-home/profile/share/emacs/site-lisp:/run/current-system/profile/share/emacs/site-lisp:/gnu/store/g1rsgv58jnqpy6q2rnhy7xzqvpjks2f4-emacs-next-pgtk-31.0.50-1.9663c95/share/emacs/31.0.50/lisp value of $EMACSNATIVELOADPATH: /home/pastor/.guix-home/profile/lib/emacs/native-site-lisp:/home/pastor/.guix-home/profile/lib/emacs/native-site-lisp value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: C++//l Minor modes in effect: eglot--managed-mode: t flymake-mode: t elpaca-use-package-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: /home/pastor/.guix-home/profile/share/emacs/site-lisp/guix-emacs hides /run/current-system/profile/share/emacs/site-lisp/guix-emacs /home/pastor/.guix-home/profile/share/emacs/site-lisp/site-start hides /run/current-system/profile/share/emacs/site-lisp/site-start /home/pastor/.emacs.d/elpaca/builds/flymake/flymake hides /gnu/store/g1rsgv58jnqpy6q2rnhy7xzqvpjks2f4-emacs-next-pgtk-31.0.50-1.9663c95/share/emacs/31.0.50/lisp/progmodes/flymake /gnu/store/1i3864529l6ckl45kc80b2y72wfigf6m-emacs-compat-30.0.2.0/share/emacs/site-lisp/compat-30.0.2.0/compat hides /gnu/store/g1rsgv58jnqpy6q2rnhy7xzqvpjks2f4-emacs-next-pgtk-31.0.50-1.9663c95/share/emacs/31.0.50/lisp/emacs-lisp/compat Features: (shadow sort mail-extr info emacsbug lisp-mnt message yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rect cl-extra eglot tree-widget wid-edit external-completion jsonrpc xref flymake thingatpt project diff ert pp ewoc debug backtrace find-func filenotify compile text-property-search pcase imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs misearch multi-isearch flymake-autoloads tramp-archive tramp-gvfs dbus xml tramp trampver tramp-integration tramp-message help-mode tramp-compat xdg shell pcomplete comint ansi-osc ring parse-time iso8601 time-date format-spec ansi-color tramp-loaddefs elpaca-menu-elpa no-littering compat no-littering-autoloads elpaca-menu-melpa elpaca-menu-org elpaca-use-package use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key use-package-core elpaca-use-package-autoloads hl-line display-line-numbers elpaca-log elpaca-ui url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars mailcap cl-seq elpaca warnings icons elpaca-process elpaca-autoloads vc-git diff-mode track-changes easy-mmode files-x vc-dispatcher cl-loaddefs cl-lib magit-popup-autoloads geiser-guile-autoloads edit-indirect-autoloads bui-autoloads guix-autoloads rx stgit-autoloads page-break-lines-autoloads dashboard-autoloads memoize-autoloads dash-autoloads s-autoloads f-autoloads all-the-icons-autoloads log4e-autoloads gntp-autoloads alert-autoloads telega-contrib-autoloads rainbow-identifiers-autoloads visual-fill-column-autoloads telega-autoloads consult-autoloads consult-notmuch-autoloads notmuch-indicator-autoloads notmuch-autoloads compat-autoloads jinx-autoloads tablist-autoloads pdf-tools-autoloads company-autoloads geiser-autoloads vterm-git.f76de08-autoloads guix-emacs rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar make-network-process tty-child-frames native-compile emacs) Memory information: ((conses 16 505081 51672) (symbols 48 23934 48) (strings 32 216943 3808) (string-bytes 1 4504841) (vectors 16 35040) (vector-slots 8 447974 25893) (floats 8 76 879) (intervals 56 2253 176) (buffers 992 26))
Sergio Pastor PΓ©rez <sergio.pastorperez@HIDDEN>:bug-gnu-emacs@HIDDEN.
Full text available.bug-gnu-emacs@HIDDEN:bug#79241; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.