GNU bug report logs - #54488
29.0.50; move-to-column/overlay-related regression in latest master, perhaps 28?

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: João Távora <joaotavora@HIDDEN>; dated Mon, 21 Mar 2022 06:54:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 13:24:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 23 09:24:11 2022
Received: from localhost ([127.0.0.1]:43133 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nX0yB-0001bo-1b
	for submit <at> debbugs.gnu.org; Wed, 23 Mar 2022 09:24:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nX0yA-0001ba-26
 for 54488 <at> debbugs.gnu.org; Wed, 23 Mar 2022 09:24:10 -0400
Received: from [2001:470:142:3::e] (port=36176 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 <eliz@HIDDEN>)
 id 1nX0y4-0006vi-RO; Wed, 23 Mar 2022 09:24:04 -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=ar4yocbBhdLSJSFRpSRxAdXhSHOurzuNPbhsvdhSN5o=; b=OYF4GcJHXikiRDS4WQFp
 E3VcbSm7M4rnKFzM9PJu5OkJHK149YfvgAiS3WHiSBAv7qVx1YACq4UCYyY3qplu5TbXGuyn4Qoia
 kMvDaqZu/vgzcBVH5DvABjC+gu7E93zB19b4FwKsMB1POPkeXzFSQ/M4z+nPy5CDOzjqSRmXQs108
 VuzP/yXC4VqueMVsup7ANhKVWt4oB5PUiNCHizhnJhxdVhSD+g57/mH3nbl5K5V6PPKtvDRJ54HNX
 pmqEJuSaOgzB2BHahm/PDt9cLYzQZrT8y/tf68Oc0tsRoVE2IPQamwgM6wEIIIegFvmuhe1nYmFvC
 No0UqvtqL803lQ==;
Received: from [87.69.77.57] (port=1169 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nX0y4-0005C1-Ak; Wed, 23 Mar 2022 09:24:04 -0400
Date: Wed, 23 Mar 2022 15:23:53 +0200
Message-Id: <83fsn8er9y.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <87k0clf0hz.fsf@HIDDEN> (message from =?utf-8?B?Sm/Do28g?=
 =?utf-8?B?VMOhdm9yYQ==?= on Wed, 23 Mar 2022 10:04:40 +0000)
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression
 in latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN>
 <835yo6f5tu.fsf@HIDDEN> <834k3qf48k.fsf@HIDDEN>
 <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
 <83pmmde484.fsf@HIDDEN> <87k0clf0hz.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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Cc: dgutov@HIDDEN,  54488 <at> debbugs.gnu.org
> Date: Wed, 23 Mar 2022 10:04:40 +0000
> 
> >> If you could consider installing clangd then running that ready-to-use recipe, I'd venture to say it's the easiest
> >> way for you to understand the problem.
> >
> > Sorry, not going to happen.
> 
> Is it because it's a non GPL server, or just because you don't like to
> install LSP servers?  Other LSP servers will probably have the same
> problem.

It's because I cannot afford the time and efforts of setting up
another compiler suite on my machine.  Too many things on my plate
already, sorry.

> I guess if you could point me to (your?) commit that changed the
> behaviour in I can do the reproduction here and see the problem
> myself, when I have time.

The commit is here: 4243747.  It fixed bug#53795.  Before the change
the low-level routines that move-to-column and current-column called
ignored display strings shown in the buffer; now they take the display
strings into consideration.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 11:08:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 23 07:08:12 2022
Received: from localhost ([127.0.0.1]:42891 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWyqa-00088k-7j
	for submit <at> debbugs.gnu.org; Wed, 23 Mar 2022 07:08:12 -0400
Received: from mail-oi1-f170.google.com ([209.85.167.170]:43877)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWyqY-00088U-6O
 for 54488 <at> debbugs.gnu.org; Wed, 23 Mar 2022 07:08:10 -0400
Received: by mail-oi1-f170.google.com with SMTP id w127so1238794oig.10
 for <54488 <at> debbugs.gnu.org>; Wed, 23 Mar 2022 04:08:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=n16kfbXc3Fd9kHxxsrmKz3Olb0sl4A8KsCKeLQ8/udw=;
 b=gC6THfF9qia0J2+o0FMg1tPdQZVhANbXIq9LY+WX6MaRyDBNNpMzViVMeKFFqXeQW/
 jebOJFkpiYEPjwO+mtb+BenY/DeGF/rhJictguE4sRrxn5vetwPgshEu4oYH34prhRsZ
 h4QGTMBcWc08AhMoHPNUgrAjbUC2/xixSiZgevTGb6bHz0Mo4qkrFDI/Z0pJY6CRJI/B
 IkHYYJqPe9+T5pc3aVcYpY+QqWS/5C5nRhBAEPQzrFzH09HxNKOlfpV3C2R+YI1D3msq
 JRcZSoUr+U1dQ6/WvDmmzBHdeHnVB3ed5RkbjOWo+4857QtYxtA2XHgAwbfCQ5LTXiKi
 JgJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=n16kfbXc3Fd9kHxxsrmKz3Olb0sl4A8KsCKeLQ8/udw=;
 b=yCCY8r50WEWb1xP95cPKKF4l/hsyCvsB6EHYsVdcEKPUoe5xD2BmtKMQ3z9DIBffZ8
 PSaQ1VlcXx6ZW8hlTBnl7z5sHUsal0ZYb3q52TubCAq1xU/haSSuLwQQ7nxg/h5Qlrkz
 ee+LXzfnECV+7u46rd9VDa6n03ZkcL3qPrVWe/IpZhC7kVyO4zKlYfc+jPS1Qm/wUkCv
 i7RM+qkLn7bdN7YAl8oCMUHtS0ObEe2L2IF9vkzaU8KY/YL82vZq4Seblm1jkrkcowBo
 QhdB0B9RyhI1AVDIdIDDUO6O4pDFHBG9bbcho3qrNhkF+xhDzJMRvNcXikwof7nQO6nq
 Gjdg==
X-Gm-Message-State: AOAM53309/UntMbYxpf1Q5xxMxsVSk3qqNH8swrn6b3aDkxpF6CkceV1
 AIqPlb3rwmDWsatDD0KUTlpABSmqo88eeLBUtp8=
X-Google-Smtp-Source: ABdhPJw9lbyTl9czA1BoqFk1bfgQKe1NA871ghStzy3yDwidY/hbPotmrM6UzMQrCj0LsW8uTv5gzLdM1MPNAQ5PUgI=
X-Received: by 2002:aca:2b0d:0:b0:2d9:dc99:3898 with SMTP id
 i13-20020aca2b0d000000b002d9dc993898mr4067552oik.209.1648033684634; Wed, 23
 Mar 2022 04:08:04 -0700 (PDT)
MIME-Version: 1.0
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN>
 <834k3qf48k.fsf@HIDDEN> <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
 <a405379e-0d87-3caf-12e6-4773741c69b2@HIDDEN>
 <CALDnm53X0CZH=XkKM3Ji=mV+5=HBYzRGm9gZiQ=83uyKkA1HMw@HIDDEN>
 <83mthhe3rp.fsf@HIDDEN> <87fsn9f07t.fsf@HIDDEN>
In-Reply-To: <87fsn9f07t.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Wed, 23 Mar 2022 11:08:55 +0000
Message-ID: <CALDnm52DnDyVQK0nYZmNiEhtWqRjrWkdBodff8e+rfboed-+8w@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000059be1005dae0be72"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54488
Cc: 54488 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@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 (-)

--00000000000059be1005dae0be72
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 23, 2022 at 10:09 AM Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN=
m> wrote:

> Eli Zaretskii <eliz@HIDDEN> writes:
>
> PS: I do invite you to read that old Eglot issue.  Since you're an
> expert on coding system conversion, maybe you know of a better, faster
> way to find the correct LSPish column in an Emacs buffer.  Maybe the
> whole search idea is completely overwrought.
>

These issues may give additional context about the need for this particular
move-to-column dance.

https://github.com/joaotavora/eglot/issues/125 (the one I gave you already)
https://github.com/joaotavora/eglot/issues/124 (the bug that prompted the
125 fix)
https://github.com/joaotavora/eglot/issues/361 (an easier to grasp
manifestation of the problem)

Also, I think the current fix of Eglot is decent.  It will be slower when
there are
company-mode overlays, but those are in much lower numbers compared to
LSP-abiding
positioning requests. And some seem to be moving away from company-mode
and its overlay-based completion display anyway.  So this is not urgent.

But I still do think there was a regression in Emacs somewhere: I've
described an
unequivocal reproduction recipe, just not something that can be shared
among us,
due to technical (or licensing) hurdles.

Jo=C3=A3o

--00000000000059be1005dae0be72
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Wed, Mar 23, 2022 at 10:09 AM Jo=C3=A3=
o T=C3=A1vora &lt;<a href=3D"mailto:joaotavora@HIDDEN">joaotavora@gmail.=
com</a>&gt; wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex">Eli Zaretskii &lt;<a href=3D"mailto:eliz@gnu.=
org" target=3D"_blank">eliz@HIDDEN</a>&gt; writes:<br>
<br>
PS: I do invite you to read that old Eglot issue.=C2=A0 Since you&#39;re an=
<br>
expert on coding system conversion, maybe you know of a better, faster<br>
way to find the correct LSPish column in an Emacs buffer.=C2=A0 Maybe the<b=
r>
whole search idea is completely overwrought.<br></blockquote><div><br></div=
><div>These issues may give additional context about the need for this part=
icular</div><div>move-to-column dance.<br></div><div><br></div><div><div><a=
 href=3D"https://github.com/joaotavora/eglot/issues/125">https://github.com=
/joaotavora/eglot/issues/125</a> (the one I gave you already) </div></div><=
div><a href=3D"https://github.com/joaotavora/eglot/issues/124">https://gith=
ub.com/joaotavora/eglot/issues/124</a> (the bug that prompted the 125 fix)<=
/div><div><a href=3D"https://github.com/joaotavora/eglot/issues/361">https:=
//github.com/joaotavora/eglot/issues/361</a> (an easier to grasp manifestat=
ion of the problem) </div></div><div><br></div><div>Also, I think the curre=
nt fix of Eglot is decent.=C2=A0 It will be slower when there are <br></div=
><div>company-mode overlays, but those are in much lower numbers compared t=
o LSP-abiding <br></div><div>positioning requests. And some seem to be movi=
ng away from company-mode <br></div><div>and its overlay-based completion d=
isplay anyway.=C2=A0 So this is not urgent.</div><div><br></div><div>But I =
still do think there was a regression in Emacs somewhere: I&#39;ve describe=
d an</div><div>unequivocal reproduction recipe, just not something that can=
 be shared among us, <br></div><div>due to technical (or licensing) hurdles=
.<br></div><div><br></div><div>Jo=C3=A3o<br></div></div>

--00000000000059be1005dae0be72--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 10:09:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 23 06:09:52 2022
Received: from localhost ([127.0.0.1]:42803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWxw7-0006Ng-UH
	for submit <at> debbugs.gnu.org; Wed, 23 Mar 2022 06:09:52 -0400
Received: from mail-wm1-f41.google.com ([209.85.128.41]:51727)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWxw6-0006NU-Ca
 for 54488 <at> debbugs.gnu.org; Wed, 23 Mar 2022 06:09:50 -0400
Received: by mail-wm1-f41.google.com with SMTP id q20so608047wmq.1
 for <54488 <at> debbugs.gnu.org>; Wed, 23 Mar 2022 03:09:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=kJesajSsA0PS933x56JEkS0IHBxTSPwgmjY0ykUO7Qg=;
 b=MFjGkUwUlMAliIy6EkI/8R9uN9QnOayXvVVlhm4o6F6YRzOCiEIGjxRv6M0GOhkWFK
 eyf1beNvifu3rroOFNGDqW4z2PovxqRD/dQxXEOMb32qm/Xg8f4BOhkMHJGtvknPCn0D
 gRa6UwdWLiBGzusJp37+01WlgkDseEgztteM+6JvOR8gWs199Rm0jq2pHWTD46xu6mQR
 DXw8rETF2RvxzGP4ZOg0Xs13COyXOtWFxUzopybi/6z+O7Wb48+uD8okt+cuzmmgMCnw
 ls1oGg9Fhw+Ojvc58/2ke9JJjA32LShI22fby2dLGiUA7wv6OJLh4iy8b4xjtiE2JYSN
 5RWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=kJesajSsA0PS933x56JEkS0IHBxTSPwgmjY0ykUO7Qg=;
 b=NaEda0nYtxCrvhyd5rjkMXO+b54d6NVoaMXHN6ZaO55VSc7wNYuCefAAqWdltn+td/
 zXYbC1/I3h9x7mcpib+AUegJwU70n+zYKdclj/UArDH/UKLnQyR0JuZlJ6llSL0KnU/+
 bUmME9OG4uYxwTrcdcKWNnydKrL4nleoXoEjtOJNZUvv31wdX0VgChcScyfRAUX9AufI
 4gjuBMw7XdOGrvNUfn3CaZU8yBgHMk6+GiYfZvuxQxC+bwdzUT1RhXv2P5dBEOKnpz6Y
 1rZmkr22Ag9HU3Oha4b04xNfKBGJ4y9q6grpaSognXP42kxDOoltl5AKDCgRt2dyXB0V
 kCbQ==
X-Gm-Message-State: AOAM531d6R8DJ8LYCjdVlp85OX5US0CSxslrFgodVIoITcFB7kn8rPWs
 wGeqoHbhe57Xa7hNieyeKUHARIDzhhvPAQ==
X-Google-Smtp-Source: ABdhPJzkF2iCNlFArDVKHtFZPnya8YPQUGgWFD7FSGeTe7Qj3wJu05ApercGpGvG9RGCAcMUPFq1nw==
X-Received: by 2002:a05:600c:3482:b0:38c:40:9b30 with SMTP id
 a2-20020a05600c348200b0038c00409b30mr8494125wmq.68.1648030184334; 
 Wed, 23 Mar 2022 03:09:44 -0700 (PDT)
Received: from krug (87-196-72-45.net.novis.pt. [87.196.72.45])
 by smtp.gmail.com with ESMTPSA id
 z12-20020a5d4d0c000000b002057d6f7053sm2614872wrt.47.2022.03.23.03.09.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 23 Mar 2022 03:09:43 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression
 in latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN>
 <835yo6f5tu.fsf@HIDDEN> <834k3qf48k.fsf@HIDDEN>
 <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
 <a405379e-0d87-3caf-12e6-4773741c69b2@HIDDEN>
 <CALDnm53X0CZH=XkKM3Ji=mV+5=HBYzRGm9gZiQ=83uyKkA1HMw@HIDDEN>
 <83mthhe3rp.fsf@HIDDEN>
Date: Wed, 23 Mar 2022 10:10:46 +0000
In-Reply-To: <83mthhe3rp.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 23 Mar
 2022 05:39:22 +0200")
Message-ID: <87fsn9f07t.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN>
>> Date: Wed, 23 Mar 2022 01:11:21 +0000
>> Cc: Eli Zaretskii <eliz@HIDDEN>, 54488 <at> debbugs.gnu.org
>>=20
>>  Tabs?
>>=20
>> Aha! yup.  This idea won't fly.  Thanks, Dmitry, I was about to push tha=
t=20
>> happily, but people definitely use tabs in their source code.=20=20
>
> How do you know to which column to move when tabs are involved?  If
> clangd assumes a tab is at a multiple of 8, and the user has tab-width
> customized to a different value, you will end up in a wrong place
> anyway.  So this case should already cause problems, and if not,
> there's some code somewhere that handles it; let it handle it now with
> forward-char as well.

As I explained before, move-to-column is only used to obtain an upper
bound of a (binary) search backwards.  That search is for the
"LSP-abiding" column, which is tricky and based on UTF-16 code units
even though the file is usually UTF-8 encoded.  The gory details are all
in this issue https://github.com/joaotavora/eglot/pull/125 from 2018.

So if I start using forward-char, my upper bound will be unnecessarily
conservative.  The whole thing won't be wrong but slower.  And because
there can be very many diagnostics and things being annotated in
positions, it can make a difference.  I benchmarked it at the time.

I also think you're supposed to agree with the LSP server about
tab-width and stuff.  I just keep my tabs at 8 like They intended and I
don't have that problem, because at least clangd correctly assumes that
default.

Jo=C3=A3o

PS: I do invite you to read that old Eglot issue.  Since you're an
expert on coding system conversion, maybe you know of a better, faster
way to find the correct LSPish column in an Emacs buffer.  Maybe the
whole search idea is completely overwrought.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 10:03:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 23 06:03:48 2022
Received: from localhost ([127.0.0.1]:42796 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWxqF-0006EY-LY
	for submit <at> debbugs.gnu.org; Wed, 23 Mar 2022 06:03:48 -0400
Received: from mail-wr1-f53.google.com ([209.85.221.53]:38864)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWxqD-0006EG-Qi
 for 54488 <at> debbugs.gnu.org; Wed, 23 Mar 2022 06:03:46 -0400
Received: by mail-wr1-f53.google.com with SMTP id t11so1330510wrm.5
 for <54488 <at> debbugs.gnu.org>; Wed, 23 Mar 2022 03:03:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=bsZFT7C8NWA8BcB+vzgTYxkG3V5/6yAMzuLVtUPfR6g=;
 b=aLqisHhfMOJvcGPKcETAHqVi/3UbusvdD3yx3xnxUy3L9s1tXrlFRaONzh3MsRfuUm
 yneJoDmCbdRZFGbu4yyZaVSd2kPJcbihsLa3hHIIEvKj2MQS0KI5xAYoqrnApeGIqAj6
 g4fySLaOVWuDcjhUgXy+lB1prVkUmSWDlNqJNSAAm/pZGSmAAFmdY0YDmkpjWd4NtsQ8
 iFRmdB/EsHRxndmEqEt9/jpU0DWwZw61I91mGAkLu2g2dl9WwnSMOKmDUFOofc8wZ6qg
 +VQek1uGjEcdB2nmC3MywIPfLsqsImPUuUDb1w7OJIZatz6Y9KjaHa4D+NT9Q+LI7jyp
 8ivQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=bsZFT7C8NWA8BcB+vzgTYxkG3V5/6yAMzuLVtUPfR6g=;
 b=kLQQqDpWkyOOssFSvPeX/UemJXWrLvH5dFutJDLvqWQAz7LXOiaJlvWdAF8uJVmgh0
 GUo16W7Kzx6oA9RYM+KrgCNQj/IVWbr9LpPKJoBwhxUJ3pwLsbI9znXZ8JuGlICWb+8r
 E/FhQcqHmPzB3NovYGhwASftCv2o/OS04rbKgGAXoFFGcJsH2O2KAzhTptKaQsNfYxx7
 TGCkU+v9vykDld/oWkeFMEDA3ney9ndIkiPRR/2JeUJaDepolcaPJb60vBrHFekepqKO
 Um1xG0SPoTEIPDGwZV+QQRZ+61mVg8v4hZ43CsR50OoYvMYnnxEO4Q6TiHF2RUwn5IV9
 +bSw==
X-Gm-Message-State: AOAM530qQukKRwxuEaEaXZb6gHxciHDobs1ZmN7Hk3wAn66LAgRDoPbX
 ArvYbozyQVNUbqrtUOGAmMwkVkb68TKnjg==
X-Google-Smtp-Source: ABdhPJw4oyqiTTlMmTlJBikWQ7Qb0rBI9rSZS9tdUsZAN6MAZZELYdYxIAkf2mj8sBgGkjlooVTDWA==
X-Received: by 2002:a5d:510d:0:b0:203:f72e:ee24 with SMTP id
 s13-20020a5d510d000000b00203f72eee24mr20405933wrt.183.1648029819459; 
 Wed, 23 Mar 2022 03:03:39 -0700 (PDT)
Received: from krug (87-196-72-45.net.novis.pt. [87.196.72.45])
 by smtp.gmail.com with ESMTPSA id
 v8-20020a1cf708000000b0034d7b5f2da0sm3697238wmh.33.2022.03.23.03.03.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 23 Mar 2022 03:03:38 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression
 in latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN>
 <835yo6f5tu.fsf@HIDDEN> <834k3qf48k.fsf@HIDDEN>
 <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
 <83pmmde484.fsf@HIDDEN>
Date: Wed, 23 Mar 2022 10:04:40 +0000
In-Reply-To: <83pmmde484.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 23 Mar
 2022 05:29:31 +0200")
Message-ID: <87k0clf0hz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN>
>> Date: Tue, 22 Mar 2022 21:05:09 +0000
>> Cc: Dmitry Gutov <dgutov@HIDDEN>, 54488 <at> debbugs.gnu.org
>>=20
>>  >  >      do (condition-case eob-err
>>  >  >             (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2=
))
>>  >  >           (end-of-buffer (cl-return eob-err))))))
>>=20
>>  I don't see how this could cause the problem you describe, but please
>>  note that encode-coding-region generally changes the text in the
>>  region, so maybe what you consider to be outside the restriction
>>  isn't?
>>=20
>> I passed it t as the last argument, so it should be non-destructive to t=
he buffer.
>
> But you do that in a loop AFAIU, so one iteration could affect the
> next ones.  But I'm just hand-waving here.

I'm not doing it a loop for destructive effect.  I'm doing it for
measuring.  If you're interested in the full 2018 story, it's
https://github.com/joaotavora/eglot/pull/125.=20
=20
>>  Anyway, do you have an example of text in which this function causes
>>  point to return such problematic values?
>>=20
>> The only example I have is the one I described already, as best as I cou=
ld. A user reported it to me, i installed
>> clangd, and I reproduced it very easily.
>>=20
>> If you could consider installing clangd then running that ready-to-use r=
ecipe, I'd venture to say it's the easiest
>> way for you to understand the problem.
>
> Sorry, not going to happen.

Is it because it's a non GPL server, or just because you don't like to
install LSP servers?  Other LSP servers will probably have the same
problem.

> And I don't see why that would be necessary: the problem happens
> entirely in Emacs Lisp, so the only thing we need from clangd is its
> output that Emacs uses.  Can't you or someone collect that and include
> it in the recipe?

Actually, I do have that, and a LSP could be built that simply replays
those logs. But this is too complex.

I guess if you could point me to (your?) commit that changed the
behaviour in I can do the reproduction here and see the problem
myself, when I have time.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 03:39:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 23:39:41 2022
Received: from localhost ([127.0.0.1]:42403 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWrqW-0004YT-TL
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 23:39:41 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49772)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWrqV-0004YF-D5
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 23:39:39 -0400
Received: from [2001:470:142:3::e] (port=57204 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 <eliz@HIDDEN>)
 id 1nWrqP-0005IL-OS; Tue, 22 Mar 2022 23:39:33 -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=JgOJuPBN801NskMuncWA8yD10rEOTYIMM/NeDpIp/ns=; b=mXtTmsJlJC1BPgumdX4c
 Xtt3H2lR/ymc3PTomJyG9k0pF1UOmv4grNUH9PYb7MyaSaV1oowNXs/Cv5ryJcR9wovP2B4AybLDk
 d6qHenrw9qswheGJzBnk2Di2rkGCtIvak7xz/JC88n75NlBSNScu/rZaZ9HSHv/KWpU2BAysgkwgH
 NQFNuF2r5TX1fTuAd0fwamiJQvIrPybrfWAHug37T4TDpw8mxhf4Yd3SXO/P7YMD38AK7Lghzhsll
 evr8j/ih4WzQHXX57ThN6YXmvEy79kpeTrqOmR122t+M+29E5SUPYoonC8HOQwvnZA9TYYNtZWsSe
 RC1bh6yLqOEpQg==;
Received: from [87.69.77.57] (port=1113 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWrqP-0000Co-2U; Tue, 22 Mar 2022 23:39:33 -0400
Date: Wed, 23 Mar 2022 05:39:22 +0200
Message-Id: <83mthhe3rp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <CALDnm53X0CZH=XkKM3Ji=mV+5=HBYzRGm9gZiQ=83uyKkA1HMw@HIDDEN>
 (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Wed, 23 Mar 2022 01:11:21
 +0000)
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN>
 <834k3qf48k.fsf@HIDDEN> <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
 <a405379e-0d87-3caf-12e6-4773741c69b2@HIDDEN>
 <CALDnm53X0CZH=XkKM3Ji=mV+5=HBYzRGm9gZiQ=83uyKkA1HMw@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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Date: Wed, 23 Mar 2022 01:11:21 +0000
> Cc: Eli Zaretskii <eliz@HIDDEN>, 54488 <at> debbugs.gnu.org
> 
>  Tabs?
> 
> Aha! yup.  This idea won't fly.  Thanks, Dmitry, I was about to push that 
> happily, but people definitely use tabs in their source code.  

How do you know to which column to move when tabs are involved?  If
clangd assumes a tab is at a multiple of 8, and the user has tab-width
customized to a different value, you will end up in a wrong place
anyway.  So this case should already cause problems, and if not,
there's some code somewhere that handles it; let it handle it now with
forward-char as well.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 03:34:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 23:34:59 2022
Received: from localhost ([127.0.0.1]:42396 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWrlz-0004Rh-9W
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 23:34:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWrlx-0004RQ-QE
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 23:34:58 -0400
Received: from [2001:470:142:3::e] (port=57158 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 <eliz@HIDDEN>)
 id 1nWrls-0004a0-EI; Tue, 22 Mar 2022 23:34:52 -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=u1v+AbIZE3JkmSGG1yeSmEgF20PVM1xkuWKcNjv7NVU=; b=WOncSzHrQGao5AWNKm5c
 LB11h3kBHs8WCpnE0wet017QHROyZrW4H2DAZDTVOuFIwUqNNOtcmhbntZ6qn/+K28Kzge7WdSFXR
 pcTQFkdCOblwbepp5w1OATS1D68zyAX5xuxFTFw0kho5fsPXDG6hVUnTlPGH+h78O7KHkeULPwQHE
 sPX98ozY8bCq4PauPKt3YB1z1JbXyNi7opj4QkKartbun5mKb+pJMMk8kFh9U6sipFKzGV18qFrx+
 l3sg/STn+tyUfjwsUzXTDBCSeg5WMlB3gf5ZsMoeKwpWPdEHDzG3U7iST+w0HElunNaXYMoj+fUek
 zz5HXcSObvAVIA==;
Received: from [87.69.77.57] (port=4800 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWrlr-0008FW-Q6; Tue, 22 Mar 2022 23:34:52 -0400
Date: Wed, 23 Mar 2022 05:34:39 +0200
Message-Id: <83o81xe3zk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <a405379e-0d87-3caf-12e6-4773741c69b2@HIDDEN> (message from
 Dmitry Gutov on Wed, 23 Mar 2022 01:55:17 +0200)
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN> <87y212b9nt.fsf@HIDDEN>
 <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN> <834k3qf48k.fsf@HIDDEN>
 <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
 <a405379e-0d87-3caf-12e6-4773741c69b2@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: 54488
Cc: 54488 <at> debbugs.gnu.org, joaotavora@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: -3.3 (---)

> Date: Wed, 23 Mar 2022 01:55:17 +0200
> Cc: 54488 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 22.03.2022 23:05, João Távora wrote:
> >      >  Why do you have to use move-to-column instead of forward-char?
> >      >
> >      > I don't remember! Is it exactly equivalent if you're standing in
> >     the beginning of the line?
> > 
> >     Yes, if you have only text in the buffer (no images etc.).
> > 
> > 
> > Hmmm, it's interesting. Maybe I should just switch to that. Seems to fix 
> > it. Until someone adds images to the source code i suppose. What's your 
> > "etc"?
> 
> Tabs?

Tabs are a problem anyway, because the compiler cannot know how wide
the tab is in the Emacs buffer.  So if move-to-column is used to get
to the place where the error is indicated, tabs should be a problem
that is already handled specially, I think.  And if so, it could be
handled specially (in a different way) when forward-char is used
instead.

Or what am I missing?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 03:30:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 23:30:03 2022
Received: from localhost ([127.0.0.1]:42379 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWrhC-00028u-AZ
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 23:30:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48242)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWrhA-00028I-2d
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 23:30:00 -0400
Received: from [2001:470:142:3::e] (port=57068 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 <eliz@HIDDEN>)
 id 1nWrgt-0003kN-UK; Tue, 22 Mar 2022 23:29:54 -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=kt/MRf8ID/f2hPYy0ufAJby2ASm6abEKXaXRXa6zgFc=; b=Xf7tIJNiX3NYrjqoutio
 JHopmZhIoFSw0pKOuj3OqBZpvYLhjWynliAv4C9hScPxZH9RAwpZFx8uadUSCUTBjPnk9iqUUw8vd
 3PXmrOpKBInerqItdc+CX4BjrM1lNbLc5KesnEb2G3dJvTV2nLC/wwvtfG4y5e/5kdJMW4/7y4CeG
 M28KZwen22qw7pOhg2/kr0DPD+1ukVQZItUPFeqm8ldWH+cdrAYdQCYuV7xa8uiR0ZIvcpLcC+s0t
 PNvwigER6Cs7tuhtVij8fDsgKpbeCFwkoNd0XphzfINQg5lUVu8h5zq1Y3gxBWJ3wCRZTqSsHbaKs
 frMHRDemjt7ZEg==;
Received: from [87.69.77.57] (port=4484 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWrgt-0003J6-8I; Tue, 22 Mar 2022 23:29:43 -0400
Date: Wed, 23 Mar 2022 05:29:31 +0200
Message-Id: <83pmmde484.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
 (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Tue, 22 Mar 2022 21:05:09
 +0000)
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN>
 <834k3qf48k.fsf@HIDDEN> <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Date: Tue, 22 Mar 2022 21:05:09 +0000
> Cc: Dmitry Gutov <dgutov@HIDDEN>, 54488 <at> debbugs.gnu.org
> 
>  >  >      do (condition-case eob-err
>  >  >             (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))
>  >  >           (end-of-buffer (cl-return eob-err))))))
> 
>  I don't see how this could cause the problem you describe, but please
>  note that encode-coding-region generally changes the text in the
>  region, so maybe what you consider to be outside the restriction
>  isn't?
> 
> I passed it t as the last argument, so it should be non-destructive to the buffer.

But you do that in a loop AFAIU, so one iteration could affect the
next ones.  But I'm just hand-waving here.

>  Anyway, do you have an example of text in which this function causes
>  point to return such problematic values?
> 
> The only example I have is the one I described already, as best as I could. A user reported it to me, i installed
> clangd, and I reproduced it very easily.
> 
> If you could consider installing clangd then running that ready-to-use recipe, I'd venture to say it's the easiest
> way for you to understand the problem.

Sorry, not going to happen.  And I don't see why that would be
necessary: the problem happens entirely in Emacs Lisp, so the only
thing we need from clangd is its output that Emacs uses.  Can't you or
someone collect that and include it in the recipe?

>  >  Why do you have to use move-to-column instead of forward-char?
>  > 
>  > I don't remember! Is it exactly equivalent if you're standing in the beginning of the line? 
> 
>  Yes, if you have only text in the buffer (no images etc.).
> 
> Hmmm, it's interesting. Maybe I should just switch to that. Seems to fix it. Until someone adds images to the
> source code i suppose. What's your "etc"?

Any "display element" that is not text, like xwidgets.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 23 Mar 2022 01:10:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 21:10:37 2022
Received: from localhost ([127.0.0.1]:42160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWpWG-0002dW-VO
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 21:10:37 -0400
Received: from mail-ot1-f50.google.com ([209.85.210.50]:39617)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWpWF-0002dK-Ob
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 21:10:36 -0400
Received: by mail-ot1-f50.google.com with SMTP id
 a17-20020a9d3e11000000b005cb483c500dso112178otd.6
 for <54488 <at> debbugs.gnu.org>; Tue, 22 Mar 2022 18:10:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=iHZz2oDRTVKIv2nYnPd0lpMB6UVNkVH+wOHsC5L1BoY=;
 b=WzCNnC/KMJYYVx4ygqK3ggBz2e3WbDPvk7DS0ODwdPySCnCTX321ugQEu2JFdcshhz
 F/T2b+gR9HfMEAnkzBSSh6VZPvo9K/UyDcnXIElKIoe1L41Z6/IM/GWBLC9u+qPeH4Di
 qP1etVYhO9w1Mtk0gSgYfWXy0EhtVoLbn3RdE2KayuOhazTnJMgrlhkJ4eXia2TLBRYy
 z57NtX/3N7bBbqz/ev8cdXyo4gkNO/tzYWJQ7O4AYSJtpRA+n6vFHC9of0t46nBtNiTg
 ryn+TiTCnpPebEIAnClCLqqbTi1EpLV1+Bl4gZF5e1vA5qGwdlStB2p5fp2mivYlZPNi
 EhNw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=iHZz2oDRTVKIv2nYnPd0lpMB6UVNkVH+wOHsC5L1BoY=;
 b=AEBFkCQZqGySYZOr7cWFtxdRIXNEizXUCS4aL6Bw4ayzaj+vkE4YJYVrVw2o2pSJ1U
 kADpwlmx03Gs5YRWAK9Kt3grhq0jVe9VFhYZh+qb/3k41Bcdvl6GTVt3uDop3f6DCBOD
 QQUMIGf9AuysOOtfTI+EmKi8QOxdnwcYAOUSrnDNko5R9b4HvRWap0jNYeXWSwZjSwI1
 OYtdx7R0Yy4yVOGr5Gt2SNEwEPYdJ2OakEf2Obn2xvd7lMgJ3axxRmdbwElQ6QmKmQNk
 FfdO/ryU/AYfTB28QnUAD6164SvFJXjwH0WZ6p/gmTzOOB0zlNM9mEzuIUJVd8KrlSGz
 vuWQ==
X-Gm-Message-State: AOAM530TGNfuUd2VqrHCY/a97FwOGD5crPj4kSKt/0MN50Qi2VNvhTVV
 kNnXGV++wfzHF5vsbfrYdq1fB83sjWsoFuo16XUXERVx
X-Google-Smtp-Source: ABdhPJw85bcahRqxx5mAJeE/Ws8zfTnJgFFCVwp+Gmn/kkznkb9jBsRN+6fhoXiQeTycEyWuWvRvZj85CU9qDk4BKHw=
X-Received: by 2002:a9d:6287:0:b0:5c9:7a58:4325 with SMTP id
 x7-20020a9d6287000000b005c97a584325mr1155939otk.317.1647997829971; Tue, 22
 Mar 2022 18:10:29 -0700 (PDT)
MIME-Version: 1.0
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN>
 <834k3qf48k.fsf@HIDDEN> <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
 <a405379e-0d87-3caf-12e6-4773741c69b2@HIDDEN>
In-Reply-To: <a405379e-0d87-3caf-12e6-4773741c69b2@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Wed, 23 Mar 2022 01:11:21 +0000
Message-ID: <CALDnm53X0CZH=XkKM3Ji=mV+5=HBYzRGm9gZiQ=83uyKkA1HMw@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
To: Dmitry Gutov <dgutov@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000003f03ea05dad8654d"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54488
Cc: Eli Zaretskii <eliz@HIDDEN>, 54488 <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 (-)

--0000000000003f03ea05dad8654d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 22, 2022 at 11:55 PM Dmitry Gutov <dgutov@HIDDEN> wrote:

> On 22.03.2022 23:05, Jo=C3=A3o T=C3=A1vora wrote:
> >      >  Why do you have to use move-to-column instead of forward-char?
> >      >
> >      > I don't remember! Is it exactly equivalent if you're standing in
> >     the beginning of the line?
> >
> >     Yes, if you have only text in the buffer (no images etc.).
> >
> >
> > Hmmm, it's interesting. Maybe I should just switch to that. Seems to fi=
x
> > it. Until someone adds images to the source code i suppose. What's your
> > "etc"?
>
> Tabs?
>

Aha! yup.  This idea won't fly.  Thanks, Dmitry, I was about to push that
happily, but people definitely use tabs in their source code.

Jo=C3=A3o

--0000000000003f03ea05dad8654d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Tue, Mar 22, 2022 at 11:55 PM Dmitry G=
utov &lt;<a href=3D"mailto:dgutov@HIDDEN">dgutov@HIDDEN</a>&gt; wrote=
:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex">On 22.03.2022 23:05, Jo=C3=A3o T=C3=A1vora wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;=C2=A0 Why do you have to use move-to-column i=
nstead of forward-char?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; I don&#39;t remember! Is it exactly equivalen=
t if you&#39;re standing in<br>
&gt;=C2=A0 =C2=A0 =C2=A0the beginning of the line?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Yes, if you have only text in the buffer (no images=
 etc.).<br>
&gt; <br>
&gt; <br>
&gt; Hmmm, it&#39;s interesting. Maybe I should just switch to that. Seems =
to fix <br>
&gt; it. Until someone adds images to the source code i suppose. What&#39;s=
 your <br>
&gt; &quot;etc&quot;?<br>
<br>
Tabs?<br></blockquote></div><div class=3D"gmail_quote"><br></div><div class=
=3D"gmail_quote">Aha! yup.=C2=A0 This idea won&#39;t fly.=C2=A0 Thanks, Dmi=
try, I was about to push that <br></div><div class=3D"gmail_quote">happily,=
 but people definitely use tabs in their source code.=C2=A0 <br></div><div =
class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">Jo=C3=A3o<br></d=
iv></div>

--0000000000003f03ea05dad8654d--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 23:55:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 19:55:28 2022
Received: from localhost ([127.0.0.1]:42100 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWoLX-0000lz-RA
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 19:55:28 -0400
Received: from mail-wr1-f42.google.com ([209.85.221.42]:34439)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1nWoLW-0000lm-0I
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 19:55:26 -0400
Received: by mail-wr1-f42.google.com with SMTP id m30so15731807wrb.1
 for <54488 <at> debbugs.gnu.org>; Tue, 22 Mar 2022 16:55:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=fzi4WDpQ7VsPdJ45X7/hgND9osKWO5IrDfaYzyNb538=;
 b=VqZRtcPSjS6a/sptg4OcJHe7AGne+fCggVFciRI8dbAm9Ao7ICZhrDTVtWh+PbRMIj
 sM0jakXGdJ0FsbFSS6VuJ3dIQ8jM9hXCgKrT5j4LPVVOECpzJhO40gOwCPI92s+DTBFt
 XmlELK5+pIAP5uXrvJ5WGXscNfEhGYN285nQgrwJZVEMFxCcOmbwSxgk/jcne+58pA8i
 ZQa9Fdeyc8VfIp7h1bZxdjpNVKPA0y8YMUTbjq7D0gW2uRutCX9kpZRRTkGhgrrr207f
 Z2jF3ahg07oR7N3RJTgJxOu+DkD9/kwVF+2IyAC1EsWqp4Dw6GwFeoSTHWMqBCZrtoXS
 KhEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=fzi4WDpQ7VsPdJ45X7/hgND9osKWO5IrDfaYzyNb538=;
 b=Hp67EniAZ9JVZHNvnzvPavBcx3yhzapcngOqj4I9P4z4UkmMwh1YlTHP5r13CgIUVZ
 Rpsr3FJw8QXYBm5q1/Xcdz+FPpW573OZrH6ub2hwIU4UI7QujyeZg7aZkEsot4e5CPK7
 2Bxi1jHsOjvUHCsigSfpQuc55rgVkRlgc1ASKlMi+FjvV96vo3ySx/3oG4sC6KXoZN2a
 NDT6zCOUZXYWRAB4i2O4ELMYCyQFR3PF817LhgskZD8kAi4NCsD6WLu0apuRKfL2Fhus
 rFaSqoR4lKkUAaVLIm5yGmogKxvzbBTb6bjtyfFjM+06FzY8E2gLLzu0rT3iVcRtMS5U
 NcIQ==
X-Gm-Message-State: AOAM533CvM4+yMjju+S9ClpFz6m0gLcdAcyvzg2ACjf0ec2/fOi1F7jV
 JZJgpAgey9o8mI1FxQTIJPA=
X-Google-Smtp-Source: ABdhPJxXd3dg1IykyUYezgu9fE+WyzsZiZSAD2/fJ8tQOYgboXNOQp+YS4dDi8ANkeuvWpYEE1COYw==
X-Received: by 2002:a05:6000:1689:b0:204:19f5:541f with SMTP id
 y9-20020a056000168900b0020419f5541fmr8434870wrd.704.1647993320004; 
 Tue, 22 Mar 2022 16:55:20 -0700 (PDT)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 q125-20020a1c4383000000b0038c770e00b5sm2976456wma.29.2022.03.22.16.55.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 22 Mar 2022 16:55:19 -0700 (PDT)
Message-ID: <a405379e-0d87-3caf-12e6-4773741c69b2@HIDDEN>
Date: Wed, 23 Mar 2022 01:55:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.5.0
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
Content-Language: en-US
To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN> <87y212b9nt.fsf@HIDDEN>
 <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN> <834k3qf48k.fsf@HIDDEN>
 <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
 <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 54488
Cc: 54488 <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: -0.5 (/)

On 22.03.2022 23:05, João Távora wrote:
>      >  Why do you have to use move-to-column instead of forward-char?
>      >
>      > I don't remember! Is it exactly equivalent if you're standing in
>     the beginning of the line?
> 
>     Yes, if you have only text in the buffer (no images etc.).
> 
> 
> Hmmm, it's interesting. Maybe I should just switch to that. Seems to fix 
> it. Until someone adds images to the source code i suppose. What's your 
> "etc"?

Tabs?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 21:05:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 17:05:28 2022
Received: from localhost ([127.0.0.1]:42002 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWlh2-0002sq-JZ
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 17:05:28 -0400
Received: from mail-ot1-f46.google.com ([209.85.210.46]:46925)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWlh1-0002sd-Ju
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 17:05:27 -0400
Received: by mail-ot1-f46.google.com with SMTP id
 z9-20020a05683020c900b005b22bf41872so13369817otq.13
 for <54488 <at> debbugs.gnu.org>; Tue, 22 Mar 2022 14:05:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=Ild71hN2ePYlOx+6ixdSPQYuwUTCh3gP4geLaQOZ15k=;
 b=HDmXICuGYHO2fmxPhWigTzhpJjjacXmMfmg9AnUX0LGFSfm4Wkjikpb9Xzba0OEr0a
 2JZEpa8eTjxVPYjqrzML+kh2xvKOne3X3av0oDZdSfVgGMUIcK2sgtMzrNriwQaDojOo
 bYlCvxgvHpGXFzJMi5GqtTGcbtqxABXMxAB5ICY3RNzNK9VbxjyBwQDCrnYXYPz3gWFO
 tkyE5YlR8aXq+8HPC+BsweXPKDUaTf7hzBN+26fa9fKk2ag3y4T4SZCe5iiR7Lv/vU17
 NqrVutuCrkJ+nK1xC0hInsFmfxKJRmI25MLoIuFIk839BdEg6Zy189o1LSEIKoygCsFM
 z88w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=Ild71hN2ePYlOx+6ixdSPQYuwUTCh3gP4geLaQOZ15k=;
 b=dv65fBylxry7L1jNZTNFSz3ecgecRMMOknxzh7XgCowGGDpSQCN9Lq07KW3iOgWKie
 FS5LUnd6nYv3wnt6T+mW8HOBDqqDutKzsnWFQVAWydMzwciqBWEG4jQhvP/3mIkdrGNK
 ddppLv91R/TvS7QU/O/6ct/g9jh4Bivs0aLWDcI94ZHFQwdIqfA8Fe5X6O22YvWGdcVH
 UX4Wx1w+wpGci5iNO/pZaFCOd9W0T2Frnz2Y3R8P+taYebxdtRJDm7+5Q5IU1pxTOvZI
 2F/XzpAvDGtmy9SWRUihwZ2KM+Nx2EEF5ic4trQDOU6eoYHALSJTchO4ZJDnhTg4+LgP
 zEUw==
X-Gm-Message-State: AOAM5314PeOy6Kt/Efo1QAHiTl3wbOCK4zGituVxyuAa3UGl+3RmByib
 BcCXnF3RPZ+VttTbPmMsFBaqnOLk7ZoZ4B9V7+U=
X-Google-Smtp-Source: ABdhPJzk6u3JOhjswyH8OMaAx2+jyRTZptWQfYC4GtyDDqWBWm0rEx2e8E19E038u7sFrRmPBuRW/VDVxbEs8vzYcOQ=
X-Received: by 2002:a9d:6287:0:b0:5c9:7a58:4325 with SMTP id
 x7-20020a9d6287000000b005c97a584325mr856173otk.317.1647983121867; Tue, 22 Mar
 2022 14:05:21 -0700 (PDT)
MIME-Version: 1.0
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN>
 <834k3qf48k.fsf@HIDDEN> <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 <83y212dj2w.fsf@HIDDEN>
In-Reply-To: <83y212dj2w.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Tue, 22 Mar 2022 21:05:09 +0000
Message-ID: <CALDnm52PaMyrGmVNkoqsSZrQTs=u3k+SDM0BKnmjsEgZi72ANQ@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000093298c05dad4f88e"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54488
Cc: 54488 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@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 (-)

--00000000000093298c05dad4f88e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 22, 2022 at 4:54 PM Eli Zaretskii <eliz@HIDDEN> wrote:

>  >      do (condition-case eob-err
> >  >             (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))
> >  >           (end-of-buffer (cl-return eob-err))))))
>
> I don't see how this could cause the problem you describe, but please
> note that encode-coding-region generally changes the text in the
> region, so maybe what you consider to be outside the restriction
> isn't?
>

I passed it t as the last argument, so it should be non-destructive to the
buffer.

Anyway, do you have an example of text in which this function causes
> point to return such problematic values?
>

The only example I have is the one I described already, as best as I could.
A user reported it to me, i installed clangd, and I reproduced it very
easily.

If you could consider installing clangd then running that ready-to-use
recipe, I'd venture to say it's the easiest way for you to understand the
problem.

>  Why do you have to use move-to-column instead of forward-char?
> >
> > I don't remember! Is it exactly equivalent if you're standing in the
> beginning of the line?
>
> Yes, if you have only text in the buffer (no images etc.).
>

Hmmm, it's interesting. Maybe I should just switch to that. Seems to fix
it. Until someone adds images to the source code i suppose. What's your
"etc"?

Jo=C3=A3o

>

--00000000000093298c05dad4f88e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div dir=3D"ltr"><div dir=3D"ltr">On Tue, Mar 22, 2022 at=
 4:54 PM Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank=
" rel=3D"noreferrer">eliz@HIDDEN</a>&gt; wrote:</div><div dir=3D"ltr"><br>=
</div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">
&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 do (condition-case eob-err<br>
&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(forward-cha=
r (/ (if (&gt; diff 0) (1+ diff) (1- diff)) 2))<br>
&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end-of-buffer (cl-=
return eob-err))))))<br>
<br>
I don&#39;t see how this could cause the problem you describe, but please<b=
r>
note that encode-coding-region generally changes the text in the<br>
region, so maybe what you consider to be outside the restriction<br>
isn&#39;t?<br></blockquote></div></div><div dir=3D"auto"><br></div><div dir=
=3D"auto">I passed it t as the last argument, so it should be non-destructi=
ve to the buffer.</div><div dir=3D"auto"><br></div><div dir=3D"ltr"><div cl=
ass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Anyway, do you have an example of text in which this function causes<br>
point to return such problematic values?<br></blockquote><div><br></div><di=
v>The only example I have is the one I described already, as best as I coul=
d. A user reported it to me, i installed clangd, and I reproduced it very e=
asily.</div><div dir=3D"auto"><br></div><div dir=3D"auto">If you could cons=
ider installing clangd then running that ready-to-use recipe, I&#39;d ventu=
re to say it&#39;s the easiest way for you to understand the problem.</div>=
<div dir=3D"auto"><br></div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x">
&gt;=C2=A0 Why do you have to use move-to-column instead of forward-char?<b=
r>
&gt; <br>
&gt; I don&#39;t remember! Is it exactly equivalent if you&#39;re standing =
in the beginning of the line? <br>
<br>
Yes, if you have only text in the buffer (no images etc.).<br></blockquote>=
</div></div><div dir=3D"auto"><br></div><div dir=3D"auto">Hmmm, it&#39;s in=
teresting. Maybe I should just switch to that. Seems to fix it. Until someo=
ne adds images to the source code i suppose. What&#39;s your &quot;etc&quot=
;?</div><div dir=3D"auto"><br></div><div dir=3D"auto">Jo=C3=A3o</div><div d=
ir=3D"ltr"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex">
</blockquote></div></div></div>

--00000000000093298c05dad4f88e--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 16:54:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 12:54:23 2022
Received: from localhost ([127.0.0.1]:41743 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWhm2-0004mr-Uj
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 12:54:23 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55024)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWhly-0004mc-2M
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 12:54:21 -0400
Received: from [2001:470:142:3::e] (port=41544 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 <eliz@HIDDEN>)
 id 1nWhls-0008Ls-P9; Tue, 22 Mar 2022 12:54:12 -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=zvDlECi1PiBJPjLIuJnXReKUYky9IQ8HOX/FoCrmhNM=; b=XtosL1PY3OQ1d2t7SQP1
 RzD4L5e2nBBsm5nbwWIi21Nm83Zt/rdQV5az2lVakXEPzMsZ0VkOJftuaCTe5zRk5sVk7gn69Srlx
 pP/LN/gPbQVlgS/t4SfAGJJM/zW6n1dOV6eD+zY/ejHjC92/JLtHkbtj9BBSCQpuiJB4Hw14dkTUe
 2g/sR2S/ShmvpuhODtgbWxqkVD5XB01Ed7HJURZ3pPLs+NZoSaE0YOMmidLtU5bVv+qtKiOlz/8qX
 O3EORY67GpFO6qc+kOsV7TaPtkhjb0gIPxzs1Vly5nqYCL2XAMx4zDPxqOgmAbJTaJs9eqSa053R+
 zd3JWiwBtc7yHA==;
Received: from [87.69.77.57] (port=4568 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWhls-0001bN-8S; Tue, 22 Mar 2022 12:54:12 -0400
Date: Tue, 22 Mar 2022 18:53:59 +0200
Message-Id: <83y212dj2w.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
 (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Tue, 22 Mar 2022 16:06:48
 +0000)
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN>
 <834k3qf48k.fsf@HIDDEN> <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
 <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Date: Tue, 22 Mar 2022 16:06:48 +0000
> Cc: Dmitry Gutov <dgutov@HIDDEN>, 54488 <at> debbugs.gnu.org
> 
>  I don't understand how (point) can return a value outside of the
>  narrowed region, unless it runs with the narrowing temporarily
>  disabled.  Can you show me the code with that call to 'point' again?
>  I don't think I see it in your OP.
> 
> It's the snippet below. but the indentation probably botched it.
> I inlined a function in that snippet so you can see the move-to-column
> and the (point) in the same function (normally they live in different 
> functions).
> 
>  > (defun eglot-move-to-lsp-abiding-column (column)
>  >   "Move to COLUMN abiding by the LSP spec."
>  >   (save-restriction
>  >     (cl-loop
>  >      with lbp = (line-beginning-position)
>  >      initially
>  >      (narrow-to-region lbp (line-end-position))
>  >      (move-to-column column)
>  >      for diff = (- column
>  >                    (/ (- (length (encode-coding-region (or lbp (line-beginning-position))
>  >                                         (point) 'utf-16 t))   ;; <===== THAT (point)
>  >                                   2)
>  >                        2))
>  >      until (zerop diff)
>  >      do (condition-case eob-err
>  >             (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))
>  >           (end-of-buffer (cl-return eob-err))))))

I don't see how this could cause the problem you describe, but please
note that encode-coding-region generally changes the text in the
region, so maybe what you consider to be outside the restriction
isn't?

Anyway, do you have an example of text in which this function causes
point to return such problematic values?

>  Why do you have to use move-to-column instead of forward-char?
> 
> I don't remember! Is it exactly equivalent if you're standing in the beginning of the line? 

Yes, if you have only text in the buffer (no images etc.).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 16:06:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 12:06:06 2022
Received: from localhost ([127.0.0.1]:41694 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWh1J-0003bx-Pi
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 12:06:06 -0400
Received: from mail-ot1-f50.google.com ([209.85.210.50]:41905)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWh1H-0003bT-AD
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 12:06:04 -0400
Received: by mail-ot1-f50.google.com with SMTP id
 x8-20020a9d6288000000b005b22c373759so12804031otk.8
 for <54488 <at> debbugs.gnu.org>; Tue, 22 Mar 2022 09:06:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=G1XPhu7xLEy8K4pa566ljZLeGBzwuHnC1MO13sXh3+E=;
 b=KSz7lb6stOIRRuHq093Vny1esOQP2jPqFNfz03d/anPVQZHw38lg88RoLHNsjRkS3L
 TuxNVHC28oorTZpFIVAYb1tT75dPkU8ndZRmSawOieieVNZ4bvk35qN9qvOFbVY2akGP
 0b+54eDxelMWnkO3BEiNJzF96d+dMlrgHPLprY1hfh1GTkFXYcU/U+3+JXzweK66nG4D
 R7EisQXRuOKtkGTEeTWhrvdnlPMKLCedHdFnmDYrG83kFsGf4AJ51emdovzZKVuV6EbV
 L6fAJarw6FgYkBptvlZ1qODhSlBot+f75WF0AIawZd5hDtYTODCAwpRW0Bas1tmMTL9/
 R6hA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=G1XPhu7xLEy8K4pa566ljZLeGBzwuHnC1MO13sXh3+E=;
 b=p1KgJsOJNBxXrHfXTNckQZ2bhU/gQEFF0cJ9olrEqxeyBtp7WmbxM8YbeRklHCbes+
 BUUxVX4q9pu2vp4fK52dEK/unz99uU2fl9LnCcxEQXs9ed0WKrUpr2kwjQ0RTOgIy89J
 jQSsDb+PlVdMA6XTiIWPafStq5RARZ5kGbiIvayHldlVMZb/ZexT0CYUkkoNG7yFHh1+
 /aIfyfljLLe4sLagcTat+F6BP8Tofu668BlvUumi9OhM9bjoPSYcJKOjphahqyd9kZ3t
 br+1cRBgm4UkhBhhRnWPZ8aYQBNtqP4CXiP2RdSWF3/mkucypHVvll/LTvlKXHBTtq0e
 nTzg==
X-Gm-Message-State: AOAM532/eIZVs4mXNbFF5rue+SdLEgaO27EepG3ORU0iDd1saCHd7IDQ
 +yGvNzS88mBADPq7yGZWNMck5WZjo6wypwyxHzc=
X-Google-Smtp-Source: ABdhPJz0Jjbqm8aFUxa+F8O/zLIuYwBNhLGxeAQCirktRsr8RQpZ95MkkOMhRokRSr7H5DKZfeU60zDykbp08xzps8g=
X-Received: by 2002:a9d:6e13:0:b0:5ad:3397:a4ac with SMTP id
 e19-20020a9d6e13000000b005ad3397a4acmr10084673otr.340.1647965157693; Tue, 22
 Mar 2022 09:05:57 -0700 (PDT)
MIME-Version: 1.0
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN>
 <834k3qf48k.fsf@HIDDEN> <87r16uavhm.fsf@HIDDEN> <83zglidnbs.fsf@HIDDEN>
In-Reply-To: <83zglidnbs.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Tue, 22 Mar 2022 16:06:48 +0000
Message-ID: <CALDnm51k6zCprAvVDdF49Jmp7X7sSuNaD_Qiv9_Yc=+Sb_nKwg@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000d39ebb05dad0c964"
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 54488
Cc: 54488 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@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 (-)

--000000000000d39ebb05dad0c964
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 22, 2022 at 3:22 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN>
> > Cc: dgutov@HIDDEN,  54488 <at> debbugs.gnu.org
> > Date: Tue, 22 Mar 2022 14:54:13 +0000
> >
> > In Emacs 29, before the fix, that (point) seems to -- very surprisingly
> > -- return something beyond the narrowed region and so
> > encode-coding-string will complain with args out of range.
>
> I don't understand how (point) can return a value outside of the
> narrowed region, unless it runs with the narrowing temporarily
> disabled.  Can you show me the code with that call to 'point' again?
> I don't think I see it in your OP.
>

It's the snippet below. but the indentation probably botched it.
I inlined a function in that snippet so you can see the move-to-column
and the (point) in the same function (normally they live in different
functions).

> (defun eglot-move-to-lsp-abiding-column (column)
> >   "Move to COLUMN abiding by the LSP spec."
> >   (save-restriction
> >     (cl-loop
> >      with lbp =3D (line-beginning-position)
> >      initially
> >      (narrow-to-region lbp (line-end-position))
> >      (move-to-column column)
> >      for diff =3D (- column
> >                    (/ (- (length (encode-coding-region (or lbp
> (line-beginning-position))
> >                                         (point) 'utf-16 t))   ;; <=3D=
=3D=3D=3D=3D
> THAT (point)
> >                                   2)
> >                        2))
> >      until (zerop diff)
> >      do (condition-case eob-err
> >             (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))
> >           (end-of-buffer (cl-return eob-err))))))
>
> Why do you have to use move-to-column instead of forward-char?
>

I don't remember! Is it exactly equivalent if you're standing in the
beginning of the line?

Jo=C3=A3o


--=20
Jo=C3=A3o T=C3=A1vora

--000000000000d39ebb05dad0c964
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Tue, Mar 22, 2022 at 3:22 PM Eli Zaret=
skii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></d=
iv><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex">&gt; From: Jo=C3=A3o T=C3=A1vora &lt;<a href=3D"mailto:joaotavora@gmai=
l.com" target=3D"_blank">joaotavora@HIDDEN</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:dgutov@HIDDEN" target=3D"_blank">dgutov@yande=
x.ru</a>,=C2=A0 <a href=3D"mailto:54488 <at> debbugs.gnu.org" target=3D"_blank">=
54488 <at> debbugs.gnu.org</a><br>
&gt; Date: Tue, 22 Mar 2022 14:54:13 +0000<br>
&gt; <br>
&gt; In Emacs 29, before the fix, that (point) seems to -- very surprisingl=
y<br>
&gt; -- return something beyond the narrowed region and so<br>
&gt; encode-coding-string will complain with args out of range.<br>
<br>
I don&#39;t understand how (point) can return a value outside of the<br>
narrowed region, unless it runs with the narrowing temporarily<br>
disabled.=C2=A0 Can you show me the code with that call to &#39;point&#39; =
again?<br>
I don&#39;t think I see it in your OP.<br></blockquote><div><br></div><div>=
It&#39;s the snippet below. but the indentation probably botched it.</div><=
div>I inlined a function in that snippet so you can see the move-to-column<=
/div><div>and the (point) in the same function (normally they live in diffe=
rent <br></div><div>functions).<br></div><div> <br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">
&gt; (defun eglot-move-to-lsp-abiding-column (column)<br>
&gt;=C2=A0 =C2=A0&quot;Move to COLUMN abiding by the LSP spec.&quot;<br>
&gt;=C2=A0 =C2=A0(save-restriction<br>
&gt;=C2=A0 =C2=A0 =C2=A0(cl-loop<br>
&gt;=C2=A0 =C2=A0 =C2=A0 with lbp =3D (line-beginning-position)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 initially<br>
&gt;=C2=A0 =C2=A0 =C2=A0 (narrow-to-region lbp (line-end-position))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 (move-to-column column)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 for diff =3D (- column<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (=
/ (- (length (encode-coding-region (or lbp (line-beginning-position))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=
 (point) &#39;utf-16 t))=C2=A0=C2=A0 ;; &lt;=3D=3D=3D=3D=3D THAT (point)<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A02)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 2))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 until (zerop diff)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 do (condition-case eob-err<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(forward-char (/ (if (&=
gt; diff 0) (1+ diff) (1- diff)) 2))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end-of-buffer (cl-return eob-=
err))))))<br>
<br>
Why do you have to use move-to-column instead of forward-char?<br></blockqu=
ote><div><br></div><div>I don&#39;t remember! Is it exactly equivalent if y=
ou&#39;re standing in the beginning of the line? <br></div><div><br></div><=
div>Jo=C3=A3o<br></div></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" =
class=3D"gmail_signature">Jo=C3=A3o T=C3=A1vora</div></div>

--000000000000d39ebb05dad0c964--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 15:22:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 11:22:35 2022
Received: from localhost ([127.0.0.1]:41636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWgLD-0006e2-MX
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 11:22:35 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58818)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWgLC-0006dq-3B
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 11:22:34 -0400
Received: from [2001:470:142:3::e] (port=39544 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 <eliz@HIDDEN>)
 id 1nWgL6-0005vH-Qp; Tue, 22 Mar 2022 11:22:28 -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=BoddFOAbE9QJ1EqCBTyWJjE29xp0nrt1SSfQsoyojv8=; b=O845+gU5s/XTaYPhkd3m
 qesNIDWSITIYkobnlW7xhg/fz0JHido178Njjvh0ywkPeV29n9Rdcis5SNdQtLfC6bEaZBPh/uICp
 xQyw49gLXmzqS8jPYmhKVyAyVhsVUX+xUT4C48485JoiBGhNEwlavVa4Qmg3/jwrE1cDNZR9S4SGS
 dBEc4EpbZiUL2ARz3w3BySGxA2lK+nZ1twfxErnjaTSX7Wp+bzSq+4Pc39PiV0h5eZVTnHsENVsvU
 +mgnu9U7C/pdqV8PerQYe97L6CiQJJEJD3GBCnXwxnGJZMPDW116IK79fisYOkd1s31Apv4XEOGx1
 bLsEDoMpdI+cyA==;
Received: from [87.69.77.57] (port=2930 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWgL6-0008WC-A1; Tue, 22 Mar 2022 11:22:28 -0400
Date: Tue, 22 Mar 2022 17:22:15 +0200
Message-Id: <83zglidnbs.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <87r16uavhm.fsf@HIDDEN> (message from =?utf-8?B?Sm/Do28g?=
 =?utf-8?B?VMOhdm9yYQ==?= on Tue, 22 Mar 2022 14:54:13 +0000)
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression
 in latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN>
 <835yo6f5tu.fsf@HIDDEN> <834k3qf48k.fsf@HIDDEN> <87r16uavhm.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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Cc: dgutov@HIDDEN,  54488 <at> debbugs.gnu.org
> Date: Tue, 22 Mar 2022 14:54:13 +0000
> 
> In Emacs 29, before the fix, that (point) seems to -- very surprisingly
> -- return something beyond the narrowed region and so
> encode-coding-string will complain with args out of range.

I don't understand how (point) can return a value outside of the
narrowed region, unless it runs with the narrowing temporarily
disabled.  Can you show me the code with that call to 'point' again?
I don't think I see it in your OP.

> (defun eglot-move-to-lsp-abiding-column (column)
>   "Move to COLUMN abiding by the LSP spec."
>   (save-restriction
>     (cl-loop
>      with lbp = (line-beginning-position)
>      initially
>      (narrow-to-region lbp (line-end-position))
>      (move-to-column column)
>      for diff = (- column
>                    (/ (- (length (encode-coding-region (or lbp (line-beginning-position))
>                                       (point) 'utf-16 t))
>                                   2)
>                        2))
>      until (zerop diff)
>      do (condition-case eob-err
>             (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))
>           (end-of-buffer (cl-return eob-err))))))

Why do you have to use move-to-column instead of forward-char?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 14:53:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 10:53:22 2022
Received: from localhost ([127.0.0.1]:41601 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWfsv-0005uy-Tw
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 10:53:22 -0400
Received: from mail-wm1-f52.google.com ([209.85.128.52]:54007)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWfsu-0005uj-0z
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 10:53:20 -0400
Received: by mail-wm1-f52.google.com with SMTP id i186so1973967wma.3
 for <54488 <at> debbugs.gnu.org>; Tue, 22 Mar 2022 07:53:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=qoq1GguYKKRL1avfwYFsNps4DfUZF0OKDCWJ4b//sPA=;
 b=UTJvjqOv9eldVSA7ls71EHDmdudSAvihXa2GEV2D220dMdtPWUEWVTwpwx1UUbp0bD
 0tsCBq+xpkXGCm3dIskRIT/ZdnMutQSTS2g6ezC4wy0Tr/i/9nrHnSvJjIIXJJI1UZi3
 pe6nEmsg6gZTMAqERihWphE4y/39RDlWe24QILKuqFRb6THIXv+htHP/2yGlECFdqJ4w
 npixA4T59LWwbURc3q0bKNnjug3MB783kSdqnjwYguHv2cl4hDAiAvHF+ndyyMmzbrp8
 sASL9J7nja685TxtDwIOG1cB9pH8q/AsE+upSd1X3bYokRhwKpb3e4ib3WXMxvsga51n
 O7Ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=qoq1GguYKKRL1avfwYFsNps4DfUZF0OKDCWJ4b//sPA=;
 b=CwWQY/NBBTuilT2oXuQMtJqyCGXQuALEpMwmXJCKaAEd8BY+tnNXzb5vsP4Vgt/rR+
 wMzxZsG7cLs92BKykyfwdP21OAqz/FBsu0VgBivXhAiXuz99rxoidI4YQNWwURhGsNyu
 GAsGOxtl51hAkEUW0s0yv1IIvX2MS9BNB5IEbp/qdp5uYwPgMCSMXW23houd996pW3Ey
 +JChfRgNBoHnv6ineVvp5BOMVU2M6cO818hZ8/U/DNvN3+Y55E65DbRSP0mmNixQedgP
 44jGMLHhk7XtRGODdIF5VnmvqZxTGqpWW+BYiyw59s9C+XniIOSIg1Yn9a13Af+KkK8m
 En2Q==
X-Gm-Message-State: AOAM531uRCf8wXKyCg/+GaeMn6eJz9J5Ga3jPQ48htH4bBO8SS5LF+PK
 0SrPjq9h97Uc25LDVQjruMcp7uXkIJk=
X-Google-Smtp-Source: ABdhPJz8RN0Qi/LWyS0CnX5jOA32EAPiykJqKApmarI8+LUa437dF8MhCPbRzyfftYrEnVbtLs/bAw==
X-Received: by 2002:a1c:2744:0:b0:382:a9b7:1c8a with SMTP id
 n65-20020a1c2744000000b00382a9b71c8amr4096436wmn.187.1647960793677; 
 Tue, 22 Mar 2022 07:53:13 -0700 (PDT)
Received: from krug ([87.196.73.24]) by smtp.gmail.com with ESMTPSA id
 o14-20020a5d47ce000000b00203e0a21c16sm18885051wrc.3.2022.03.22.07.53.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 22 Mar 2022 07:53:13 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression
 in latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <83a6difahu.fsf@HIDDEN>
 <835yo6f5tu.fsf@HIDDEN> <834k3qf48k.fsf@HIDDEN>
Date: Tue, 22 Mar 2022 14:54:13 +0000
In-Reply-To: <834k3qf48k.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 22 Mar
 2022 16:31:39 +0200")
Message-ID: <87r16uavhm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> So I need your help with understanding what exactly fails in the
> original use case, due to this change.  Specifically, how does the
> code involved in this use move-to-column/current-column when there are
> display strings with embedded newlines around?

I think I alluded to/explained this in the original bug report.  I'll
try again: eglot needs just move-to-column that it runs in a narrowed
region containing only the line and obtain an upper bound of the
"LSP-abiding" column that the LSP server means (unfortunately the
LSP-abiding column may differ from Emacs's understanding of columns
because of different assumpting regarding length of character
encodings).

Eglot then gets (point) and tries "encode-coding-string" to measure
things.

In Emacs 29, before the fix, that (point) seems to -- very surprisingly
-- return something beyond the narrowed region and so
encode-coding-string will complain with args out of range.

In the example I gave you, that narrowed region, (point-max) is 176.

- that (point) form returns 179 in Emacs 29 -- error obviously.
- that (point) form returns 167 in Emacs 27 -- no error.

This is the code more or less in Eglot:

(defun eglot-move-to-lsp-abiding-column (column)
  "Move to COLUMN abiding by the LSP spec."
  (save-restriction
    (cl-loop
     with lbp =3D (line-beginning-position)
     initially
     (narrow-to-region lbp (line-end-position))
     (move-to-column column)
     for diff =3D (- column
                   (/ (- (length (encode-coding-region (or lbp (line-beginn=
ing-position))
                                      (point) 'utf-16 t))
                                  2)
                       2))
     until (zerop diff)
     do (condition-case eob-err
            (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))
          (end-of-buffer (cl-return eob-err))))))

Jo=C3=A3o






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 14:32:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 10:32:03 2022
Received: from localhost ([127.0.0.1]:41557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWfYJ-0002rc-7C
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 10:32:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44360)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWfYH-0002lr-R1
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 10:32:02 -0400
Received: from [2001:470:142:3::e] (port=38604 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 <eliz@HIDDEN>)
 id 1nWfYB-0006JP-7S; Tue, 22 Mar 2022 10:31:56 -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=S192ng0NC9z0IUY0aYcAMYyyDNYr3WEVPFKCFAolxDE=; b=SBs+zYImxcWd
 uETsPF8DDBMIP0bQAi8MbxTjx4AC4xGeWpmK00yf7EwUeAAY54Kv3GgTLs9QegZbBX3lX55serln0
 PYWFUzTR0ow2GOOZRGUCX/soopAV+iLAtVzcjZn5YXmP12jowVkB1gehWieGBuVLpwsJZKCkiDDXs
 ddQ6cvk558qU9zUUxh0vGnp4KhZc1UybpvpZbvp85WCVO9JNJ9M1pdQa6N9uvw+xRjU0CEn6d64Ct
 0AMSutBeScIG6jIewVmcCgFmx+G0xI5vzIJuEQuJwxWDEIkK31pUfKyi222fcsDOpdpnpNcmD7QQG
 2lVG8pRe6tmW8jc9UkNX9w==;
Received: from [87.69.77.57] (port=3463 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWfYA-0000Tz-KW; Tue, 22 Mar 2022 10:31:54 -0400
Date: Tue, 22 Mar 2022 16:31:39 +0200
Message-Id: <834k3qf48k.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: joaotavora@HIDDEN, dgutov@HIDDEN
In-Reply-To: <835yo6f5tu.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 22
 Mar 2022 15:57:17 +0200)
Subject: Re: bug#54488: 29.0.50;
 move-to-column/overlay-related regression in latest master, perhaps
 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN> <87y212b9nt.fsf@HIDDEN>
 <83a6difahu.fsf@HIDDEN> <835yo6f5tu.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54488
Cc: 54488 <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 (---)

> Date: Tue, 22 Mar 2022 15:57:17 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 54488 <at> debbugs.gnu.org, dgutov@HIDDEN
> 
> I think I see the problem.  Stay tuned.

I definitely see a problem with display strings with embedded
newlines, but I don't think I understand how it affects your use case.

Try this simple recipe:

  emacs -Q
  M-: (overlay-put (make-overlay 91 100) 'display "FOOBAR\nBAZQUUX") RET

You should then see this in *scratch (I indented by 2 columns, so it
stands out):

  ;; This buffer is for text that is not saved, and for Lisp evaluation.
  ;; To create a fileFOOBAR
  BAZQUUXt it with C-x C-f and enter text in its buffer.

(with the "FOOBAR\nBAZQUUX" part intangible, i.e. you cannot put the
cursor inside).

Now go to the 't' at the end of "BAZQUUXt" and type "C-x =".  In Emacs
28 and earlier you will see "column=28", in Emacs 29 you will see
"column=32".  This is because Emacs 28 ignores the display string and
examines only the buffer text, which is "covered" by the display
property.  By contrast, Emacs 29 ignores the "covered" buffer text
(since it's invisible on display) and examines only the characters of
the display string.  Since the newline has a width of zero, we get 9
columns between "file" and "t with" in Emacs 28, but 13 in Emacs 29.

So yes, Emacs 29 behaves differently, but the important part is that
both Emacs 28 and Emacs 29 are wrong: the _real_ column at 't' is 7
(columns are zero-based).  IOW, both Emacs 28 and Emacs 29 fail to
account for the fact that the newline inside the display string resets
the column to zero.

I could perhaps come up with a solution for that, and have the above
snippet correctly return 7 as the column.  But I don't see how this
will help company-mode and/or Eglot, since the value returned by Emacs
28 makes no more sense than the value returned by Emacs 29.

So I need your help with understanding what exactly fails in the
original use case, due to this change.  Specifically, how does the
code involved in this use move-to-column/current-column when there are
display strings with embedded newlines around?

TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 13:57:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 09:57:38 2022
Received: from localhost ([127.0.0.1]:41430 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWf10-00060v-0h
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 09:57:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34698)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWf0y-00060h-K2
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 09:57:37 -0400
Received: from [2001:470:142:3::e] (port=37998 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 <eliz@HIDDEN>)
 id 1nWf0t-0000Yf-7D; Tue, 22 Mar 2022 09:57:31 -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=CdYFt2L5OH/Naw69NduVs0578lD07T5i0k3MAcfb00Y=; b=XfGq2C1StUB9
 po9SRZIy3r3Dt3EeVogsM6MOvEpM3F0GzfAc6mCfSG4uJn8Jr4DnYl/uYYmv428T6PNg9MvFA/lPG
 pGLp4GBWC/YuUAOfW0j9M4tGrp3FzPUb9GTtprV7utv6OGruRcr1wTtk3ackXF207ZJeqOcxdkW1b
 5G9VloFL0cSugy7pzfhOwuLju8eK6mzqEI9+Znm4qr65PgLnzdvr4hp5LmqsopJB07uJ/5D1OYuPI
 3VL6XlpNzGZsZdGHESWR9uoN7QPrxvzydf9PYkZjfc66plwG3Uj4TE3GEX3VLYI2d3Xmtv9M2DR2J
 tiMDM3WDWpGyio+45v1klw==;
Received: from [87.69.77.57] (port=1319 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWf0s-0005rK-J9; Tue, 22 Mar 2022 09:57:30 -0400
Date: Tue, 22 Mar 2022 15:57:17 +0200
Message-Id: <835yo6f5tu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: joaotavora@HIDDEN
In-Reply-To: <83a6difahu.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 22
 Mar 2022 14:16:29 +0200)
Subject: Re: bug#54488: 29.0.50;
 move-to-column/overlay-related regression in latest master, perhaps
 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN> <87y212b9nt.fsf@HIDDEN>
 <83a6difahu.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> Date: Tue, 22 Mar 2022 14:16:29 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 54488 <at> debbugs.gnu.org, dgutov@HIDDEN
> 
> > > You can try putting a multiline string on the 'display property.
> > >
> > > Instead of just "BAR".
> > 
> > I tried that, but I don't know how to align it like company does.
> > 
> > > Apart from that, I can only suggest reading the code and
> > > experimenting.
> > 
> > I admit I was hoping that you as company maintainer/specialist :-) could
> > provide a small snippet to create a dummy but company-realistic overlay
> > of, say, two completion "foo" and "bar" in the middle of any buffer.  Or
> > perhaps explain in layman's terms how company constructs its overlays.
> > 
> > Not asking that you get to the root of the move-to-column problem, which
> > is clearly a regression (presumably a regression to correct behaviour,
> > but a regression nonetheless) just help perhaps come up with a simpler
> > repro to assist Eli in seeing the issue.
> 
> Thank you for your efforts.  I will take a look at this issue when I
> have time, hopefully soon enough.

I think I see the problem.  Stay tuned.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 13:49:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 09:49:29 2022
Received: from localhost ([127.0.0.1]:39351 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWet7-0005HX-B4
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 09:49:29 -0400
Received: from mail-oa1-f51.google.com ([209.85.160.51]:39031)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWet6-0005HM-8h
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 09:49:28 -0400
Received: by mail-oa1-f51.google.com with SMTP id
 586e51a60fabf-d39f741b2bso1732729fac.6
 for <54488 <at> debbugs.gnu.org>; Tue, 22 Mar 2022 06:49:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=2Pk0i+oi4zZUMJqPHidI87QTnNDTtfUMnP4BUo2+kag=;
 b=NACvCGxz2K/8UUXZHY+JGlk0HwT+YkXSUyu1u24vnfrIXBHSZx23PSYAFfUtruIzOs
 m0PVDLgD//YX1aXJ7gPYW8zr/qy2bfNHk3NQoWZ3dG+sSaLIAtVqeNXnHJ9NfIkKYqUo
 jSQuTkp9+jFBJUX9zau37gouyRGBmw+aYqWb9athSKk+MLDB1KRCsokwOkTf6f2+jWl3
 eLBk+wpm7hpl3dVyS1pLGpHxQythcyHu3Rkee26fXmL5qGhCBLDRGXNBsqdBHmiWvW3y
 JaPb8iHd6wftXrsyAAp5k/JBuTxCnO2bzJq7EdWetmA0YhmENYKJ+V+nu6eHFfF6WceJ
 CqPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=2Pk0i+oi4zZUMJqPHidI87QTnNDTtfUMnP4BUo2+kag=;
 b=c+wk/UwIfwbR1G11UC9KFMft6pShoW0UC5jxjHFrAd9WgC7hDniINU/IZY7Zxytz82
 EDEq7ezeNNp7dYHgPAa5ZmZfj5onr6uMGpecRTJFEWGymgn3YQWXU5HIfnVr0EKYnmRy
 y0MUieUgHNyrEU08s5snpmZ9ptbmc05ePOUkeIFsX+rEeiAjxJsGb+i3Xv7R+Q8fThyV
 IxorX5aoqyg8uL4KUTpEwzXZQGZO7e42jQhUj9nrc5CXq0u7CQQDQpHIpt9FHokYyxdv
 f3TwrFADOBEfLG8yg2vsYuGg6sjWvOD7Dchv2omeQQwtqObwz09lGw21j9c2xwZS8d93
 svOQ==
X-Gm-Message-State: AOAM532fwZCZefFwq1BV2sNLkIxuacjXTRvJUj8UpkXJOmDkZpAU51jq
 WOGpFSCsUbAL9B2T+YspOxctPJVlmpAzsAnDPkQ=
X-Google-Smtp-Source: ABdhPJxSGw4CJzIeJCoxAsB9uXrgPJcXdukwf8Hz43nYNwN36PRdz3LTPgNSboEaNiV+rbkrfMxq8pADxYCF26Okyfs=
X-Received: by 2002:a05:6870:5884:b0:dd:af00:a8c7 with SMTP id
 be4-20020a056870588400b000ddaf00a8c7mr1596559oab.209.1647956962635; Tue, 22
 Mar 2022 06:49:22 -0700 (PDT)
MIME-Version: 1.0
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
 <87y212b9nt.fsf@HIDDEN> <8ae3e6b3-c601-bd58-46cd-805d5b05ee36@HIDDEN>
In-Reply-To: <8ae3e6b3-c601-bd58-46cd-805d5b05ee36@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Tue, 22 Mar 2022 13:50:13 +0000
Message-ID: <CALDnm51e7p4XchpGXDC5Nge_QHZPWn3ueG7_NwZoKaA2uDbCDA@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
To: Dmitry Gutov <dgutov@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000005cf1e505dacee117"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54488
Cc: Eli Zaretskii <eliz@HIDDEN>, 54488 <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 (-)

--0000000000005cf1e505dacee117
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 22, 2022 at 12:33 PM Dmitry Gutov <dgutov@HIDDEN> wrote:


> > I tried that, but I don't know how to align it like company does.
> Have you tried 'before-string as well?
>

Yes, same thing.

I think it would be faster for you to just read the code.
>

I think you overestimate my ability.


> I'm not sure you need a realistic-looking overlay, though.
>

It's a good idea to drift as little as possible from the only case that we
know that actually triggers the problem, which is "real" company mode.

Jo=C3=A3o

--0000000000005cf1e505dacee117
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Tue, Mar 22, 2022 at 12:33 PM Dmitry G=
utov &lt;<a href=3D"mailto:dgutov@HIDDEN">dgutov@HIDDEN</a>&gt; wrote=
:<br></div><div class=3D"gmail_quote"><div>=C2=A0</div><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex">
&gt; I tried that, but I don&#39;t know how to align it like company does.<=
br>
Have you tried &#39;before-string as well?<br></blockquote><div><br></div><=
div>Yes, same thing. <br></div><br><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">
I think it would be faster for you to just read the code.<br></blockquote><=
div><br></div><div>I think you overestimate my ability.<br></div><div>=C2=
=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px =
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I&#39;m not sure you need a realistic-looking overlay, though.<br>
</blockquote></div><div><br></div><div>It&#39;s a good idea to drift as lit=
tle as possible from the only case that we</div><div>know that actually tri=
ggers the problem, which is &quot;real&quot; company mode.<br></div><br><di=
v dir=3D"ltr" class=3D"gmail_signature">Jo=C3=A3o<br></div></div>

--0000000000005cf1e505dacee117--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 12:33:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 08:33:23 2022
Received: from localhost ([127.0.0.1]:39310 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWdhT-0003R2-7u
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 08:33:23 -0400
Received: from mail-ej1-f43.google.com ([209.85.218.43]:42756)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1nWdhR-0003Qo-Q5
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 08:33:22 -0400
Received: by mail-ej1-f43.google.com with SMTP id j15so21778020eje.9
 for <54488 <at> debbugs.gnu.org>; Tue, 22 Mar 2022 05:33:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=peDV8aigOewCEXQkBwxKSvikhebZu6pq9wvQ7lmS544=;
 b=J17n/VCGh812Qg2ogr1qNEWDs7TNGL4a5qkh5oUg96LRpT2zi2oexLBegH0YpgxsIj
 xE2SeAoPF6NrgUUM6AQmzdvgdimDo+luQiFh7PFPHAyTipM6lcYQNxleT/pXxoZ2FxD6
 TwtbJXc07LhBH6e1RA326pg2FXizjzrvCDsckhOuk0JupouS/+3A9/eyg46/mCT2dM6f
 wDF0HcKY5/NkmYooafQ+PRQFixFJi8RLNUqQR9j22oczZruEa6r1ADPCJqfvvLF8MeOz
 eHQwQ/tntoJPEB73x1iLTO4Jm/tdsq6qUlu0nZ+GpPcQh+9J1ItL0A9Vbdb9Pytmm2Fz
 h5DQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=peDV8aigOewCEXQkBwxKSvikhebZu6pq9wvQ7lmS544=;
 b=mLHbvhWxxpRLYhngRCn0lUTQqE18EonW0wc8Nk0NSG7tUxAV+3J+nvi0z3wmcXMTTA
 Y2ZXGlEfso58qjfzsQpJjMjTGhIr0USNKS7kHiTUJNeOlC3xaVt66/hx96orEE+qLHL+
 V8e+XH6M+fB1XI0oxby+tCqCdMyRUg3ahIyrizsenR+oAEOB3eWbpdFFRc9e+/2qYjPl
 ledZUl+IqFyFdGWav9yo4ZMWLafGkn9rpfE9JBEXxVSU5C13tSgWUwl49izPPH0VlYGR
 4YznuRluGksF+iRWrob5ZRaDOEOkEBjchV6UDDyXs5kPNCy4IMYzhfG4I5nYPA5MsEPf
 JVGQ==
X-Gm-Message-State: AOAM5309YkkPj8C4lIewj+dmrCSHm0VKpXluL/DmpbOV+6mIF7Zg8eDX
 h6WRNhozTMVTvcahgfCuS+8=
X-Google-Smtp-Source: ABdhPJzopaff3idWlE3hd+tNGeoG2mqKN4KKpi2+FJ8wG+bhHKgCXMyYd6whkacxkFtbfgArTePYcA==
X-Received: by 2002:a17:907:7f93:b0:6db:7634:f214 with SMTP id
 qk19-20020a1709077f9300b006db7634f214mr24942259ejc.3.1647952395749; 
 Tue, 22 Mar 2022 05:33:15 -0700 (PDT)
Received: from [192.168.236.48] ([173.237.64.48])
 by smtp.googlemail.com with ESMTPSA id
 y27-20020a170906519b00b006dfaf4466ebsm5857926ejk.116.2022.03.22.05.33.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 22 Mar 2022 05:33:15 -0700 (PDT)
Message-ID: <8ae3e6b3-c601-bd58-46cd-805d5b05ee36@HIDDEN>
Date: Tue, 22 Mar 2022 14:33:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.5.0
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
Content-Language: en-US
To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN> <87y212b9nt.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <87y212b9nt.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 54488
Cc: Eli Zaretskii <eliz@HIDDEN>, 54488 <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: -0.5 (/)

On 22.03.2022 11:48, João Távora wrote:
> Dmitry Gutov <dgutov@HIDDEN> writes:
> 
>> On 21.03.2022 23:59, João Távora wrote:
>>> So maybe Dmitry has some valuable insight as to how exactly company
>>> constructs its overlay or overlays.
>>
>> You can try putting a multiline string on the 'display property.
>>
>> Instead of just "BAR".
> 
> I tried that, but I don't know how to align it like company does.

Have you tried 'before-string as well?

>> Apart from that, I can only suggest reading the code and
>> experimenting.
> 
> I admit I was hoping that you as company maintainer/specialist :-) could
> provide a small snippet to create a dummy but company-realistic overlay
> of, say, two completion "foo" and "bar" in the middle of any buffer.  Or
> perhaps explain in layman's terms how company constructs its overlays.

I think it would be faster for you to just read the code.

I'm not sure you need a realistic-looking overlay, though.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 12:16:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 08:16:51 2022
Received: from localhost ([127.0.0.1]:39303 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWdRS-00032D-NV
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 08:16:50 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33060)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWdRQ-00031z-CR
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 08:16:48 -0400
Received: from [2001:470:142:3::e] (port=35888 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 <eliz@HIDDEN>)
 id 1nWdRL-00085e-58; Tue, 22 Mar 2022 08:16:43 -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=d0aT8CEGnUkOa3v/9uDcEcHoZKdhzECcbgHRmB747aE=; b=YFEY9cK7mGV0/8/okcPi
 Kgv5NAcYR+F0/93Xn5Ht+5BjB/ke3f83OH5mFpH3UCBlxgpsAwXG+Y4VABNvtn79XBuWIymKMEpdX
 7mxHjO+lYBJKnXHTpvGHorRY/9UaEKllVc5LrwLPw71sDdEhtVAsi1yW9AMjI+MR3BHcYVZII4mTl
 sYOkFHA+bDqM5l37AUX3NW9D135uK1DP0a+IoqSo7SwITcVSSC+/LlykafYnl7hccCEjL04YYV8R2
 l7BNSlnM7WKUqlj8ZSXprV67EWi1V9wzkL9EV9o9gRiqiOfAshbhAN8zDezBMVq4sZQ1rQgUr31LA
 KfHTLYUV2nW6kg==;
Received: from [87.69.77.57] (port=2883 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWdRK-0001xF-L2; Tue, 22 Mar 2022 08:16:42 -0400
Date: Tue, 22 Mar 2022 14:16:29 +0200
Message-Id: <83a6difahu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <87y212b9nt.fsf@HIDDEN> (message from =?utf-8?B?Sm/Do28g?=
 =?utf-8?B?VMOhdm9yYQ==?= on Tue, 22 Mar 2022 09:48:06 +0000)
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression
 in latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN> <87y212b9nt.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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  54488 <at> debbugs.gnu.org
> Date: Tue, 22 Mar 2022 09:48:06 +0000
> 
> Dmitry Gutov <dgutov@HIDDEN> writes:
> 
> > On 21.03.2022 23:59, João Távora wrote:
> >> So maybe Dmitry has some valuable insight as to how exactly company
> >> constructs its overlay or overlays.
> >
> > You can try putting a multiline string on the 'display property.
> >
> > Instead of just "BAR".
> 
> I tried that, but I don't know how to align it like company does.
> 
> > Apart from that, I can only suggest reading the code and
> > experimenting.
> 
> I admit I was hoping that you as company maintainer/specialist :-) could
> provide a small snippet to create a dummy but company-realistic overlay
> of, say, two completion "foo" and "bar" in the middle of any buffer.  Or
> perhaps explain in layman's terms how company constructs its overlays.
> 
> Not asking that you get to the root of the move-to-column problem, which
> is clearly a regression (presumably a regression to correct behaviour,
> but a regression nonetheless) just help perhaps come up with a simpler
> repro to assist Eli in seeing the issue.

Thank you for your efforts.  I will take a look at this issue when I
have time, hopefully soon enough.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 22 Mar 2022 09:47:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 22 05:47:15 2022
Received: from localhost ([127.0.0.1]:39215 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWb6g-0005SC-Ux
	for submit <at> debbugs.gnu.org; Tue, 22 Mar 2022 05:47:15 -0400
Received: from mail-wm1-f46.google.com ([209.85.128.46]:42821)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWb6f-0005Rz-3Q
 for 54488 <at> debbugs.gnu.org; Tue, 22 Mar 2022 05:47:13 -0400
Received: by mail-wm1-f46.google.com with SMTP id
 r190-20020a1c2bc7000000b0038a1013241dso1009228wmr.1
 for <54488 <at> debbugs.gnu.org>; Tue, 22 Mar 2022 02:47:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=nAMGFQpzdT/x0TDv8xBChijdwVk9pveq+FRV2Yx52D8=;
 b=jZmfe4mNEhutYrp0QZRJYBcaJl3qGsaWJMKiYC3Vx5LQnZ5EIsHnkq7Rb/dolkfI7/
 +fclXdEE1aAeMySl5HWdj3P2y80J1MQQkUTSN/GhidBBUmzYm6i87yNv+6VpCr3x9/Bw
 hjJZjFiSSFOWYdgHGgR+1X8g2fheZBLNXc8YzSpqqd2PwBkrq/O6OqTmGHzd9sejcCnD
 Y0XqSQVZK5a75B59vHZ0PJMV7lQZClvZOgT7RXos5SgW12gdGs3oHnBod9YcRpNvFSeo
 l2o+1mb/TPqQkXN7VhZOSQ4RCM4JWMyVMzSMFVtT2+Vg+GVQ+sFWG+UTOchPLjEEEM/n
 Xlww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=nAMGFQpzdT/x0TDv8xBChijdwVk9pveq+FRV2Yx52D8=;
 b=Sf7Lz3xcyn60BpkWkus18QwRoixl0eQt+dRz4zoeBxjEgHc7PuWkoub9RSYuBmOPiD
 FdL7Nq+srxy0i2PNlVbzRsFeaN2+6zXCSQyOqtX3KiOX3bCF6gFyBtDob93k8d3/wILC
 vKc9Vh+6In8+QhZpFJ0ZjacigOb8gc1mfC9h/iWDleiNWEZLtD9j2Ztx/Noep2pBV/vy
 SWisRRHdbHduIgTmoRetlRbyN/mE3T/GxvLxhV/lRXS+uwpKoUjxB+jHkjrkbxFGVGJv
 qadMbKdoVjVRcaOAY6uD1hBUE+54JjmqeQOe4P3IiN025WPAnrs4Qn6Ay5a5ChPORGZ0
 Gs9g==
X-Gm-Message-State: AOAM531KYMJw5QGYgqOZ5z2HsD6fU6fcdogoarlxA/FtjBz398FzZhpa
 D4a7KB7Zc2wTgjVEfGn63QMDEB2yviw=
X-Google-Smtp-Source: ABdhPJxs8lzUE8HoREH9l9rbpp0+z4Wnlz2oh6xFAV80tyTOVkote/fKed0+0AuLj7IMf7RVVciL4Q==
X-Received: by 2002:a05:600c:1ca4:b0:38c:987e:5feb with SMTP id
 k36-20020a05600c1ca400b0038c987e5febmr2890893wms.27.1647942426706; 
 Tue, 22 Mar 2022 02:47:06 -0700 (PDT)
Received: from krug ([87.196.73.141]) by smtp.gmail.com with ESMTPSA id
 z12-20020a5d4d0c000000b002057d6f7053sm322375wrt.47.2022.03.22.02.47.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 22 Mar 2022 02:47:06 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression
 in latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
 <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
Date: Tue, 22 Mar 2022 09:48:06 +0000
In-Reply-To: <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN> (Dmitry Gutov's
 message of "Tue, 22 Mar 2022 01:14:02 +0200")
Message-ID: <87y212b9nt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
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: 54488
Cc: Eli Zaretskii <eliz@HIDDEN>, 54488 <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 (-)

Dmitry Gutov <dgutov@HIDDEN> writes:

> On 21.03.2022 23:59, Jo=C3=A3o T=C3=A1vora wrote:
>> So maybe Dmitry has some valuable insight as to how exactly company
>> constructs its overlay or overlays.
>
> You can try putting a multiline string on the 'display property.
>
> Instead of just "BAR".

I tried that, but I don't know how to align it like company does.

> Apart from that, I can only suggest reading the code and
> experimenting.

I admit I was hoping that you as company maintainer/specialist :-) could
provide a small snippet to create a dummy but company-realistic overlay
of, say, two completion "foo" and "bar" in the middle of any buffer.  Or
perhaps explain in layman's terms how company constructs its overlays.

Not asking that you get to the root of the move-to-column problem, which
is clearly a regression (presumably a regression to correct behaviour,
but a regression nonetheless) just help perhaps come up with a simpler
repro to assist Eli in seeing the issue.

But there's no urgency.  This, I understand, is not in Emacs 28 and
there is a workaround in Eglot.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 21 Mar 2022 23:14:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 21 19:14:12 2022
Received: from localhost ([127.0.0.1]:38731 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWRE4-0003wk-E5
	for submit <at> debbugs.gnu.org; Mon, 21 Mar 2022 19:14:12 -0400
Received: from mail-ed1-f41.google.com ([209.85.208.41]:45877)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1nWRE3-0003wU-60
 for 54488 <at> debbugs.gnu.org; Mon, 21 Mar 2022 19:14:11 -0400
Received: by mail-ed1-f41.google.com with SMTP id u26so4129191eda.12
 for <54488 <at> debbugs.gnu.org>; Mon, 21 Mar 2022 16:14:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=WBjkZ9M39hOMJS0xQYidWGimpByXjW2MWq6uBzumxZE=;
 b=fzM1UDgxuoy4mWknEcRw0/MYvIMlGyuyWxtW2s9bGhk80jKX9nex/Uiz45uUu3WE8O
 pL0Mw4jFPmDwrltbez46SeoYOSgNhHSTELdBAihGDMxLc+/8Y1Fpfxnevh9JYJdKYo00
 vpBJGMMohcl2QrxshczWBQM3xlISMgfSPzLDGGVff7triDib1419fYOJqgtmYJdl8+aj
 d4buJ35tqhjIH21pGpwGC2OV4cfPnBan0WKQVoA8LTCgIiHZTsu66ih5Lgzl8LIcpa9u
 o4Q7eiR8P8qLV8WBOm1UfqSlGdiLTdp0WpucQe7uFrO4jeMO6QaUW2YIkoa79H680RDH
 20TA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=WBjkZ9M39hOMJS0xQYidWGimpByXjW2MWq6uBzumxZE=;
 b=hiE3rI3QgA+YXWAnbzTCogDF69BaTfesaJpqfyLl2sOsYALsznb7mhIif2/gOLLZIp
 adIsVjRPu2baJEHWmfyp+rJJ9bkwyDhH7Gb6e0uNVgz9rQ9QVgznFCY/0X92tFWoKqs5
 1Id6whqJF/VXo8lxV16E+JXqTG5jSv9zvmyq+jpcFDfp2f+m9I+dI6bw4Pd3+MmzWOSV
 cxFiuKpWP0xptCYr9orGVJW4ZiOFvSZ3eEaq5vL1LKYsiBEznBaB/7nnGm15N2HRs3eS
 0CjBJA3frqAWXvRemwDxLPWr2VB1GYHfB6PEER8YYXE0BndVn6bg3+NWJJoBxLzlMN3L
 yT1g==
X-Gm-Message-State: AOAM531AN/KNN9VdN3KrVgJ4NZsXG1VGblNs0WRq+uLAN9LFTLQtsEfO
 Rmw5p3Ge6ErNrRhyIHCm3ng=
X-Google-Smtp-Source: ABdhPJxw9UEbk1IdI+KSp01M76W/UcA+60ReHlneMR9i+akL3Z5CUfLPgOP/pGwvt2mLl3oHSYH7Pg==
X-Received: by 2002:a05:6402:430d:b0:419:45cd:7ab1 with SMTP id
 m13-20020a056402430d00b0041945cd7ab1mr6056644edc.367.1647904445305; 
 Mon, 21 Mar 2022 16:14:05 -0700 (PDT)
Received: from [192.168.236.48] ([173.237.64.48])
 by smtp.googlemail.com with ESMTPSA id
 o12-20020a50c90c000000b0041907e62024sm5695098edh.85.2022.03.21.16.14.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 21 Mar 2022 16:14:04 -0700 (PDT)
Message-ID: <6095582d-7065-8089-e8c7-857f070f8ce2@HIDDEN>
Date: Tue, 22 Mar 2022 01:14:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.5.0
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
Content-Language: en-US
To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN> <8735jbc6gj.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <8735jbc6gj.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 54488
Cc: 54488 <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: -0.5 (/)

On 21.03.2022 23:59, João Távora wrote:
> So maybe Dmitry has some valuable insight as to how exactly company
> constructs its overlay or overlays.

You can try putting a multiline string on the 'display property.

Instead of just "BAR".

And/or use 'before-string instead of 'display.

Apart from that, I can only suggest reading the code and experimenting.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 21 Mar 2022 21:58:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 21 17:58:49 2022
Received: from localhost ([127.0.0.1]:38656 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWQ37-0003V4-Fj
	for submit <at> debbugs.gnu.org; Mon, 21 Mar 2022 17:58:49 -0400
Received: from mail-wm1-f46.google.com ([209.85.128.46]:35821)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWQ35-0003Uq-9d
 for 54488 <at> debbugs.gnu.org; Mon, 21 Mar 2022 17:58:47 -0400
Received: by mail-wm1-f46.google.com with SMTP id
 v2-20020a7bcb42000000b0037b9d960079so400979wmj.0
 for <54488 <at> debbugs.gnu.org>; Mon, 21 Mar 2022 14:58:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=K9LxXlqSDTS0C7IQAmBFV6xQzUeWoqvxOXgWWStlF34=;
 b=gD1cFxP/mpcKkBUI+dxIYTTDO2699qIgExzQbd7osZtrN5vrHU1AdNQ1jpqyfgUUEf
 rmcmMxVBXk2qmJKhGTSIauQ582rnqMt+05/IAjM0NMLSWryacsREP/nqH6Jr9Flb0lzG
 9XegbXBrQTmi4fcdo1KRRF2/UZlGqQ8txX7AzeYn7g2SpAMXCStRyx8TR4pBsUmY9xMK
 t1GlnMUAA8F0iqfNtL6T3iCAlgR40oXBVgrK9738V/HXExCPNJQhFJabfkO0e4NSJyps
 pTJUGaIRgXSbyv1g/Rxr249FpWR/u1ZC3aAD3ByRC4jW+3wYTetvJOiA89kVWPUAfDYG
 s4PA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=K9LxXlqSDTS0C7IQAmBFV6xQzUeWoqvxOXgWWStlF34=;
 b=UfjuKh0+0GOmX3NFhSekSv7kePYNCCGR1/eqAYivtSJG0biHcfIhgHo4UwxWqZuzYI
 bUrwfhAnyARCammRRLq79WXUp5ijOYuFJr3wwtZmCvYvb4F37uR2xGjwzKUbxDLQe9zE
 5gv7yD+3Q3zt8nHIcRCmgi7KePRwesTPrTnUbeyCMF/b1k+f4soX9jMj2UhmW5PDULu9
 7BZMTUCOqLt80Bij9dCYnny5AuIv+STeBX9ypwnHOPHCZxHqwkeYGJtfoI7cA/2Y1Bsw
 TMc+w1QVDTsplCqiJi5b/xX+X2+jWPwCTz7m4DWDM6NjjUvPKGd9zNIj4OTG6HbuB8sW
 RQ7Q==
X-Gm-Message-State: AOAM533rLlAlkANchD3AOqXym6BXJNTfeR0tvDwrKgf3+d5hqA40NUp8
 MqPfxjWXOdrlJR8X1HJQW5k=
X-Google-Smtp-Source: ABdhPJzDSE2lyPZIA9MAmqbOn+TniXSXC0GNSnUFro9mHmNlBJomWNUe7TkVDvNPjKGwAvn5mHQK2w==
X-Received: by 2002:a05:600c:1c1e:b0:38c:b393:b355 with SMTP id
 j30-20020a05600c1c1e00b0038cb393b355mr985322wms.92.1647899920936; 
 Mon, 21 Mar 2022 14:58:40 -0700 (PDT)
Received: from krug ([87.196.73.141]) by smtp.gmail.com with ESMTPSA id
 q11-20020adfcd8b000000b001e320028660sm14002166wrj.92.2022.03.21.14.58.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 21 Mar 2022 14:58:40 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression
 in latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 <83fsnbfd72.fsf@HIDDEN>
Date: Mon, 21 Mar 2022 21:59:40 +0000
In-Reply-To: <83fsnbfd72.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 21 Mar
 2022 19:05:53 +0200")
Message-ID: <8735jbc6gj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN>
>> Date: Mon, 21 Mar 2022 16:37:18 +0000
>> Cc: 54488 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
>>=20
>> If you are aware of the behaviour change , then I don't see the point=20
>> with coming up with a simpler repro: I'd just be showing what you=20
>> confirmed: that move-to-column now is affected by overlays such
>> as company's whereas before (emacs 27.2/28) it didn't.
> The questions is: does current-column, move-to-column, etc. on master
> indeed report the column number and move to the place whose column
> number _on_display_ is as you ask them?  If they do, then this is the
> correct behavior, and features that expect something else should
> adapt.

I agree, though bug-compatibility is a thing sometimes :-)

Anyway, since you seem to know what changed in Emacs, can you show a
snippet which worked in some (presumably wrong) way in 27.1 and now
works correctly in master? Maybe that holds some valuable clue..

> But if move-to-column moves to a column that is visually incorrect,
> I'd still like a simple reproducer.

Hmmm.  I tried, but couldn't

(with-current-buffer (generate-new-buffer "**test**")
  (insert "foofoofoo\nbarbarbar\nbazbazbaz")
  (forward-line -1)
  (goto-char (line-beginning-position))
  (prog1
      (let ((o (make-overlay (+ 3 (point)) (+ 6 (point)))))
        (overlay-put o 'invisible t)
        (overlay-put o 'display (propertize "BAR" 'face 'highlight))
        (goto-char (line-beginning-position))
        (let ((p (point)))
          (move-to-column 3)
          (buffer-substring-no-properties p (point))))
    (pop-to-buffer (current-buffer))))

This constructs an overlay that hides/replaces some text and eventually
returns "barbar".  If the overlay weren't there it would return "bar",
obviously.  I don't now if "barbar" is correct.  It doesn't look
especially correct, but I wouldn't know what to return here either,
since the text below is invisible and has probably been skipped over.
At any rate, it's exactly the same that 27.1 does, so it's not the
problem we're after, I think.

So maybe Dmitry has some valuable insight as to how exactly company
constructs its overlay or overlays.

> Even if one must use company-mode and eglot, can you post a recipe
> that doesn't involve their installation via package.el?  Suppose I
> download the relevant *.el files to my system and manually load them
> as needed, can you show a recipe that loads whatever is needed and
> then reproduces the issue?

Yes, I can do that.  But note you still need the clangd executable
somewhere in your system to provide the completions.  In my system
it was just:

  sudo pacman -S clang

but packages exist for most (all?) GNU/Linux distributions and OSs.

Then, assuming:

  ~/Source/Emacs/emacs is a checkout of master Emacs
  ~/Source/Emacs/company-mode is a checkout of git@HIDDEN:company-mode/=
company-mode.git
  ~/Source/Emacs/eglot is a checkout of git@HIDDEN:joaotavora/eglot.git

IMPORTANT: You need Eglot to be checked out at d5c7c40b, before the
Eglot "defensive" fix.

Then finally, this should set you up and should show you the differences
beween 27.2 and master Emacs, where the former works and the latter
errors.  Obviously in the master version you don't need these 5 loads.

$ some-version-of-emacs -Q                                         \
  -l ~/Source/Emacs/emacs/lisp/emacs-lisp/eldoc.el                 \
  -l ~/Source/Emacs/emacs/lisp/progmodes/xref.el                   \
  -l ~/Source/Emacs/emacs/lisp/progmodes/flymake.el                \
  -l ~/Source/Emacs/emacs/lisp/progmodes/project.el                \
  -l ~/Source/Emacs/emacs/lisp/jsonrpc.el                          \
  -L ~/Source/Emacs/company-mode -l company -f global-company-mode \
  -L ~/Source/Emacs/eglot -l eglot.el                              \
  ~/tmp/issue-860/args_out_of_range.c                              \
  -f eglot                                                         \
  -f display-line-numbers-mode                                     \
  -f toggle-debug-on-error=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20

The args_out_of_range.c file's contents are

------BEGIN
// args_out_of_range.c
struct Book {
  int id;
  char title[50]
} book =3D { 1024, "C" };

int main(int argc, char *argv[])
{

  // Master errors when typing "book." i.e.
  // typing the dot after book
  book
  return 0;
}
------END


Hope this helps,=20
Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 21 Mar 2022 17:06:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 21 13:06:18 2022
Received: from localhost ([127.0.0.1]:38028 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWLU1-0003Fv-Rn
	for submit <at> debbugs.gnu.org; Mon, 21 Mar 2022 13:06:18 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37592)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWLTz-0003Fh-BS
 for 54488 <at> debbugs.gnu.org; Mon, 21 Mar 2022 13:06:16 -0400
Received: from [2001:470:142:3::e] (port=46240 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 <eliz@HIDDEN>)
 id 1nWLTu-0005bh-5x; Mon, 21 Mar 2022 13:06:10 -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=B1z6FiS+TeYDZ3oetcI1T961/VgUMqw10Ko6rjn5LTE=; b=c2snyB5pzvD9SuD/g4iI
 DUjZfLh77WbZqW2rqcDH3NZPNH300kk6D1GGiMP2XQ/apfvfoXu8uo/xS6omAqZSoV4ldFZ+9RanU
 ECDuW6gcxS2L6cnp1kKbhTiq2qW76Jr8wv6rNzRoYyFXAif1gs7z79up0l1VtpWtBO0X0Hl3rFwPb
 OCPuUZIdo+v9bzo+TNLqhbCYDVPxVdZ52qkQjQYQWrL8BRtDWVGwijRhMZp1UkHQ/zIoCRiOtmYQf
 JOU9OaCeKazGjL4yD32emPskALnqyiMkkzsDe33I1zo5egSdyWDex3E3TUtrp+yATsrxoD6hwSrhC
 yKFjuAS/5Pqrgw==;
Received: from [87.69.77.57] (port=3555 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWLTt-00049d-Kq; Mon, 21 Mar 2022 13:06:09 -0400
Date: Mon, 21 Mar 2022 19:05:53 +0200
Message-Id: <83fsnbfd72.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
 (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Mon, 21 Mar 2022 16:37:18
 +0000)
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
 <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Date: Mon, 21 Mar 2022 16:37:18 +0000
> Cc: 54488 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
> 
> If you are aware of the behaviour change , then I don't see the point 
> with coming up with a simpler repro: I'd just be showing what you 
> confirmed: that move-to-column now is affected by overlays such
> as company's whereas before (emacs 27.2/28) it didn't.

The questions is: does current-column, move-to-column, etc. on master
indeed report the column number and move to the place whose column
number _on_display_ is as you ask them?  If they do, then this is the
correct behavior, and features that expect something else should
adapt.  But if move-to-column moves to a column that is visually
incorrect, I'd still like a simple reproducer.  Even if one must use
company-mode and eglot, can you post a recipe that doesn't involve
their installation via package.el?  Suppose I download the relevant
*.el files to my system and manually load them as needed, can you show
a recipe that loads whatever is needed and then reproduces the issue?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 21 Mar 2022 16:36:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 21 12:36:34 2022
Received: from localhost ([127.0.0.1]:37963 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWL1G-0006NV-E2
	for submit <at> debbugs.gnu.org; Mon, 21 Mar 2022 12:36:34 -0400
Received: from mail-oi1-f178.google.com ([209.85.167.178]:38433)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWL1F-0006NJ-73
 for 54488 <at> debbugs.gnu.org; Mon, 21 Mar 2022 12:36:33 -0400
Received: by mail-oi1-f178.google.com with SMTP id n7so16775230oif.5
 for <54488 <at> debbugs.gnu.org>; Mon, 21 Mar 2022 09:36:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=fE1FU9qU9KEmAFYGgQTXLYefM/ZN9Gqs1ZK0CEMvnGM=;
 b=cZSmNsdYwkj0ryW6AupUPLc5r5bjE7JpiUX0Kf2sy5OayLPquoOiNy5sPSMdLivOn/
 0ZhF4SU4toIUfXVGNox7H/LxzmsNzsXD5YYQ6GghkGGYb9V1kdaM7wGNkN9ckHpdlh7J
 sQ9O9GdapiIQAwSvE6L2U28x6rF4g6tgy0nqcpE3IR3r9W1pyTQW3pbB0hrpuGt3K/fm
 8pKGE6nhq5lCT4lp+Wq9jQe3vgWrHPnDIHxm5AlWPc7+XzAxodqN5WuboDfekjIZVOcM
 DAOv53XL44+4MuKI7HjdDX0kYWoGPM2t0albDgMFW0EtsHSbpARH2jn8ly/AG6O8fft5
 OUyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=fE1FU9qU9KEmAFYGgQTXLYefM/ZN9Gqs1ZK0CEMvnGM=;
 b=fvBlefZXwJ7fB20reqgVefR6aii9eDOsXMxXZCkjVDbP1CxkhEPuKvt7T7AR2hlBdS
 b42j/QwkqH75hHjK4JwT3/UOD8JdkHAIT/6D+YUgRkcum7d6CQALJoGljsnVJ7mMAY19
 mawo7TUKB4LYpqxkyq2vfJMjLIq4Vt4Gs7hAWoa/6v2jiF3e2VCkNGx1bY7Pmvh2urGp
 DpWQ7lDeJGmzmxx7396raW5yYFNi/eTCxTQDFl4gW0vCi0f9DrKLjs1aptzXtnZ4J2c3
 JNExB1VZZu+g+bzL43UfK/aix2S2AH00iy7cauSZZJP/tLw8xYPXfv0Mhbp/DYev5Q3k
 T+Sg==
X-Gm-Message-State: AOAM5332HHI8MXS93zggOpddKxwc03eGOOOaRVlcVd2M6Y2zSt2biQc3
 XiPfGVzKMOrkqZn4lYQJjOTxtNDXnVL8A5c/m8Q=
X-Google-Smtp-Source: ABdhPJzySp4gNNdMJsdAC0/w3+AGBnTlGhmk9JD1gsQm3jjeecnl0CuVoKy1zvgG408p+cU3qOO5rt7xpLQhLVmaDfM=
X-Received: by 2002:aca:2b0d:0:b0:2d9:dc99:3898 with SMTP id
 i13-20020aca2b0d000000b002d9dc993898mr13659414oik.209.1647880587461; Mon, 21
 Mar 2022 09:36:27 -0700 (PDT)
MIME-Version: 1.0
References: <87bkxzdccp.fsf@HIDDEN> <831qyvfpv4.fsf@HIDDEN>
In-Reply-To: <831qyvfpv4.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Mon, 21 Mar 2022 16:37:18 +0000
Message-ID: <CALDnm53Wb9v1qRSB2RX_uKqB6=hrNi2+8aOnCyNRfHJ1BnX7sg@HIDDEN>
Subject: Re: bug#54488: 29.0.50; move-to-column/overlay-related regression in
 latest master, perhaps 28?
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000000c48b305dabd1943"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54488
Cc: 54488 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@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 (-)

--0000000000000c48b305dabd1943
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Mar 21, 2022 at 12:32 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> Emacs 29 has a fix for an old bug, whereby current-column etc. didn't
> take display strings and overlays into account; now they do.
>
> Of course, it could be that this fix introduced a bug in some
> not-so-simple situations, so I'd appreciate if you could show a simple
> recipe to reproduce the problem without the need of firing up
> company-mode and/or Eglot.
>

The only pathological problem -- that I know of -- is the "not-so-simple"
example/situation I described.  But it's pretty real and easy trigger
if you happen to use those two extensions which are both reasonably
popular.

If you are aware of the behaviour change , then I don't see the point
with coming up with a simpler repro: I'd just be showing what you
confirmed: that move-to-column now is affected by overlays such
as company's whereas before (emacs 27.2/28) it didn't.

If this is a bugfix in Emacs, then the logical conclusion is that the
problem should be fixed in company-mode.  It should somehow (tm)
find a way to create a visual popup that works in terminals for which
move-to-column behaves as before. Alternatively, some variation of
move-to-column that retains the old behaviour could be invented to
give the old behaviour.

Both these solutions would be better than the current defensive
one in Eglot, which makes Eglot LSP-abiding column-finding
less performant than it used to be.

Jo=C3=A3o

--0000000000000c48b305dabd1943
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Mon, Mar 21, 2022 at 12:32 PM Eli Zare=
tskii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></=
div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex">
Emacs 29 has a fix for an old bug, whereby current-column etc. didn&#39;t<b=
r>
take display strings and overlays into account; now they do.<br>
<br>
Of course, it could be that this fix introduced a bug in some<br>
not-so-simple situations, so I&#39;d appreciate if you could show a simple<=
br>
recipe to reproduce the problem without the need of firing up<br>
company-mode and/or Eglot.<br></blockquote><div><br></div><div>The only pat=
hological problem -- that I know of -- is the &quot;not-so-simple&quot;</di=
v><div>example/situation I described.=C2=A0 But it&#39;s pretty real and ea=
sy trigger <br></div><div>if you happen to use those two extensions which a=
re both reasonably</div><div> popular.<br></div><div><br></div><div>If you =
are aware of the behaviour change , then I don&#39;t see the point <br></di=
v><div>with coming up with a simpler repro: I&#39;d just be showing what yo=
u <br></div><div>confirmed: that move-to-column now is affected by overlays=
 such</div><div>as company&#39;s whereas before (emacs 27.2/28) it didn&#39=
;t.</div><div><br></div><div>If this is a bugfix in Emacs, then the logical=
 conclusion is that the</div><div>problem should be fixed in company-mode.=
=C2=A0 It should somehow (tm)</div><div>find a way to create a visual popup=
 that works in terminals for which <br></div><div>move-to-column behaves as=
 before. Alternatively, some variation of <br></div><div>move-to-column tha=
t retains the old behaviour could be invented to <br></div><div>give the ol=
d behaviour.</div><div><br></div><div>Both these solutions would be better =
than the current defensive</div><div>one in Eglot, which makes Eglot LSP-ab=
iding column-finding <br></div><div>less performant than it used to be.</di=
v><div><br></div><div>Jo=C3=A3o<br></div></div></div>

--0000000000000c48b305dabd1943--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at 54488 <at> debbugs.gnu.org:


Received: (at 54488) by debbugs.gnu.org; 21 Mar 2022 12:32:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 21 08:32:42 2022
Received: from localhost ([127.0.0.1]:36085 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWHDG-0007kK-9f
	for submit <at> debbugs.gnu.org; Mon, 21 Mar 2022 08:32:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41436)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nWHDE-0007k6-Tc
 for 54488 <at> debbugs.gnu.org; Mon, 21 Mar 2022 08:32:41 -0400
Received: from [2001:470:142:3::e] (port=41176 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 <eliz@HIDDEN>)
 id 1nWHD9-00057V-M0; Mon, 21 Mar 2022 08:32:35 -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=Mdg+3q8c84D1YgJ2pGGmY16p/7btvLpJbLPQbKiQAT4=; b=LLXLV6GHMhUZuBjebIGq
 bZFvhPaSzgGAvKEPisQRPQMMxt9q3XSD8l4inb4lGXrBPo2ucwd9Ewxvsuu/9G89cJZDIEXZsz1dK
 wzUXpfyKKXshsKg7kQZGvAosDm/qOfZN159HPxhGm6akKkvEsv02ggHrqOaQxA7S4sdM19b7nwYHs
 JLEHb1wtNajrcqJz/v611nooKA0hccGP/ajiHIW7V1if9BHYdSpbrGhECzEhtda258dd+dApdq013
 GfVh07CAJgIAb8RCosDVp2J/LQBTrDFXd2SBKbh9q4ah6MHjlg0Dn3cUxnkWsEG/LJYuEsj85Y+1A
 +MRU9B3x2OvKpg==;
Received: from [87.69.77.57] (port=4084 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nWHD5-0005fl-Uz; Mon, 21 Mar 2022 08:32:33 -0400
Date: Mon, 21 Mar 2022 14:32:15 +0200
Message-Id: <831qyvfpv4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <87bkxzdccp.fsf@HIDDEN> (message from =?utf-8?B?Sm/Do28g?=
 =?utf-8?B?VMOhdm9yYQ==?= on Mon, 21 Mar 2022 06:54:46 +0000)
Subject: Re: bug#54488: 29.0.50;
 move-to-column/overlay-related regression in latest master, perhaps
 28?
References: <87bkxzdccp.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: 54488
Cc: 54488 <at> debbugs.gnu.org, dgutov@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: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Date: Mon, 21 Mar 2022 06:54:46 +0000
> Cc: dgutov@HIDDEN
> 
> In short, it seems that in the presence of the overlays created by
> company-mode and in presence of a narrowing, the move-to-column function
> does not function the way it used to.

Yes.

> Eglot uses 'move-to-column' to go that precise place and highlight the
> warning.
> 
> In Emacs 27.2, move-to-column is unaffected by previous company-mode
> overlays, even if the current line is being co-used visually by the
> overlay.  It moves to the right buffer position.
> 
> In Emacs master, this isn't true.  It seems to be confounded by the
> company-mode overlay and moves to eob, _beyond the narrowing_, which
> eventually breaks Eglot with a backtrace such as this one:

Emacs 29 has a fix for an old bug, whereby current-column etc. didn't
take display strings and overlays into account; now they do.

Of course, it could be that this fix introduced a bug in some
not-so-simple situations, so I'd appreciate if you could show a simple
recipe to reproduce the problem without the need of firing up
company-mode and/or Eglot.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Mar 2022 06:53:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 21 02:53:56 2022
Received: from localhost ([127.0.0.1]:35700 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nWBvP-0005CK-VJ
	for submit <at> debbugs.gnu.org; Mon, 21 Mar 2022 02:53:56 -0400
Received: from lists.gnu.org ([209.51.188.17]:52816)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1nWBvO-0005CD-Vw
 for submit <at> debbugs.gnu.org; Mon, 21 Mar 2022 02:53:55 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51256)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joaotavora@HIDDEN>)
 id 1nWBvO-000808-Li
 for bug-gnu-emacs@HIDDEN; Mon, 21 Mar 2022 02:53:54 -0400
Received: from [2a00:1450:4864:20::32e] (port=56311
 helo=mail-wm1-x32e.google.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <joaotavora@HIDDEN>)
 id 1nWBvM-0004iW-QH
 for bug-gnu-emacs@HIDDEN; Mon, 21 Mar 2022 02:53:54 -0400
Received: by mail-wm1-x32e.google.com with SMTP id n35so6298073wms.5
 for <bug-gnu-emacs@HIDDEN>; Sun, 20 Mar 2022 23:53:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=3eQ+EsbKXh7t7EQ5jBhJV1MUSZQmB9ojMiA+RwqoWKA=;
 b=nUZz8Ib/1syC0G6xT546h0HG3ijp7VxiCTOHC3LzbYJyAjgzjW2Rg7lsa6oWE1619s
 /uPaY3zOuJSyq3GhimtmEJ7pgwfb3wp29S8bVP+OZssq388TARQkvLBrthCNP71YmKty
 00rhGzRx0wrx4VIGFkAtP/Q+RiroexQViN3Hq1yU6pXY6yG79ys2tMYjiHxsrIZKFVfn
 LLe0TDPYZp2kpIxXAFf1JH6eYPTJOxErkN5NG9x5UX1+oWgAIph4tv8tmkqZmbBJ2oN6
 a7nzzvtEkmE+NMxoq5RiMpZX3k3HyJ/N5sKegtzj0lp6Ln4rSCSnsnNQMMc1NQO0or9n
 tiGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=3eQ+EsbKXh7t7EQ5jBhJV1MUSZQmB9ojMiA+RwqoWKA=;
 b=2zTkDF/9gbl3wxYdNz6pgPbqJgQDju3l+moD/vBHbfrdoAv+MYcS+nNdrXAgCyR95o
 UMi7/x6SE26uMW5rFJR2wjVOhM8zZFBuH+Vp03TYYQD5NklvWecUVY9VEkTOXZiIhEQp
 kFDFZ80aCibyBZEbPV9Gk9Me5hIf5ECAKgeHVhcfdWki6QW2YPWTlbLUmGyZHVyak4E9
 iMkKOWMMzepn19bQuvmZ6PGcpRw3SotSbMknYQwApPhnQiEA9uMlAceK0Uf80mrdxWgd
 PV06ERrlTY0g8AYhHniGqMHcn1E8tG2THvXNhWEwXahFLUaI+x8Iicea1ZPf7Q3n4x3U
 KXwA==
X-Gm-Message-State: AOAM531DFiEYYhINgB10S6NVJM0aRuH53IhmtkJWUrwQYRdTUzpOmzcU
 4xuy0+ouOFsPgAdr0HemMIxi6tBXwZOpng==
X-Google-Smtp-Source: ABdhPJzGyTrm1A/88DjYTDZyLKtMVnSewM14Kwvq072TySi4owlAu3htcIrECwkfF+h8D99OvjHe+w==
X-Received: by 2002:a05:600c:1f17:b0:38b:b2b3:9faa with SMTP id
 bd23-20020a05600c1f1700b0038bb2b39faamr25141439wmb.190.1647845631091; 
 Sun, 20 Mar 2022 23:53:51 -0700 (PDT)
Received: from krug ([87.196.73.90]) by smtp.gmail.com with ESMTPSA id
 i15-20020a5d584f000000b00204171ba528sm1149957wrf.109.2022.03.20.23.53.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 20 Mar 2022 23:53:50 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; move-to-column/overlay-related regression in latest
 master, perhaps 28?
Date: Mon, 21 Mar 2022 06:54:46 +0000
Message-ID: <87bkxzdccp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32e
 (failed)
Received-SPF: pass client-ip=2a00:1450:4864:20::32e;
 envelope-from=joaotavora@HIDDEN; helo=mail-wm1-x32e.google.com
X-Spam_score_int: -6
X-Spam_score: -0.7
X-Spam_bar: /
X-Spam_report: (-0.7 / 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,
 PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: dgutov@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: -2.3 (--)

Hello maintainers,

This bug I'm about to describe originated in
https://github.com/joaotavora/eglot/issues/860.  I reproduced it with:

* GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu) commit 88d474308e2
* company-mode, a not-too-recent version (but most recent is the same)
* the clangd LSP server 13.0.1
* Eglot d5c7c40bc

We are reasonably sure the bug is in Emacs and is a regression from
Emacs 27.2.  The bug has been "defensively" worked around in the Eglot
in its commit f775187115.

In short, it seems that in the presence of the overlays created by
company-mode and in presence of a narrowing, the move-to-column function
does not function the way it used to.

It should certainly be possible to reproduce the problem without the
reasonably complex Eglot setup, but for the time being this is all I
have.
=20=20=20=20
  ~/Source/Emacs/emacs/src/emacs -Q -f package-initialize -L       \
  ~/Source/Emacs/company-mode -l company -f global-company-mode -l \
   eglot.el ~/tmp/issue-860/args_out_of_range.c -f eglot -f        \
   display-line-numbers-mode -f toggle-debug-on-error

Here's the args_out_of_range.c file.

  1 // args_out_of_range.c
  2 struct Book {
  3   int id;
  4   char title[50]
  5 } book =3D { 1024, "C" };
  6
  7 int main(int argc, char *argv[])
  8 {
  9
 10   // Error when typing the dot to make "book."
 11   book
 12   return 0;
 13 }

When one types the dot after the "book" on line 11, company-mode
displays a two-line overlay that visually encompasses line 12 after
"book", which has the "return 0;" statement.  That line happens to
also hold a warning about incorrect syntax, one that starts at column
2.

Eglot uses 'move-to-column' to go that precise place and highlight the
warning.

In Emacs 27.2, move-to-column is unaffected by previous company-mode
overlays, even if the current line is being co-used visually by the
overlay.  It moves to the right buffer position.

In Emacs master, this isn't true.  It seems to be confounded by the
company-mode overlay and moves to eob, _beyond the narrowing_, which
eventually breaks Eglot with a backtrace such as this one:

Debugger entered--Lisp error: (args-out-of-range #<buffer args_out_of_range=
.c> 110 124)
  encode-coding-region(110 124 utf-16 t)

Thanks for your time,
Jo=C3=A3o






Acknowledgement sent to João Távora <joaotavora@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#54488; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 23 Mar 2022 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.