GNU bug report logs - #64988
30.0.50; move-to-column can move across lines if there is a text with display property

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: Herman, Géza <geza.herman@HIDDEN>; Keywords: notabug wontfix; merged with #66942; dated Tue, 1 Aug 2023 10:55:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 64988 66942. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug unarchived. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug archived. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 64988-done <at> debbugs.gnu.org:


Received: (at 64988-done) by debbugs.gnu.org; 2 Sep 2023 16:39:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 02 12:39:09 2023
Received: from localhost ([127.0.0.1]:38410 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qcTeO-0001d0-Rv
	for submit <at> debbugs.gnu.org; Sat, 02 Sep 2023 12:39:09 -0400
Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:48587)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1qcTeM-0001cS-PB
 for 64988-done <at> debbugs.gnu.org; Sat, 02 Sep 2023 12:39:07 -0400
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-500d13a8fafso248744e87.1
 for <64988-done <at> debbugs.gnu.org>; Sat, 02 Sep 2023 09:38:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1693672731; x=1694277531; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=i6KRvG1ayMOmXhec0FWNxPe7Z1GIW4GuWpDSMi31nxo=;
 b=MvWAllu9Lioe1GVNbLg5EMb5wAlYt/3f7Q5JO3dQtmRzWxFRfPejf9yEXD23wsRKTI
 BG1Wf2ZgiU800sN7DOEQ7a1zeOSMuE9VrjHBlcYIeRUg5dNYE0xZV2ARFVg3+eF/GcMQ
 eMFVVduJG6jinnZX2l1yo45O5gI+fSprroMjbtAMpLbi3l6G6//Tm4QPjt9G4IBT7IIM
 D1ncFgRSPULO36wdbkU2LmKy+rmIyLQB2ni3nU2B8Az2Yl1Mlnnh1WOYcMYK6gt5+KXA
 j3kWAia2CkplmFKsVfdibNQmDC3B3lvIL9dks4WeCWvzqVVymXN3kiBCL5/pWYLXUnYk
 iUrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1693672731; x=1694277531;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=i6KRvG1ayMOmXhec0FWNxPe7Z1GIW4GuWpDSMi31nxo=;
 b=c/7WBurA9xq0PNGTUetfe/K0HtHXEo+14et/0anna1or4ASGaM9Vv9zRMbx8LLAoZ5
 3J7Pnu9BOUY0ebUmw9hl2vOIyBiaxgubZflZrk7myS62pebSJqHpR1zxDltN0c3dboBk
 ox4ieaAonZ7Y7GoI+rhcFB9lMf4ks/nnrDMfLAMbogS39B75Qi110G+h3eTTm+HIl/7i
 NoEt/ANNl+WidmhvRCASnmIVl2HC+/t6OWR6vFiilm+yoppr+riJatzR9ZC6O6ELYtbd
 sNmeMWjtZUendKnpB/oUUov0tD/S3gxS4owixhslEd84xi+XxgW3UqUxGuDCQcCz3u4A
 nW2g==
X-Gm-Message-State: AOJu0YzRtRn7WPA36IR0QqG7rWeZ69/hzm2yJr3lwAwp1ycCPpHpqXj1
 qAPF/7u1WpFEoV3SGwa4bG/zRYFePj6O8xrXyUg=
X-Google-Smtp-Source: AGHT+IERzHKOqWViOrlE000qq67tmSl8nTChoQNyjT7GGVCgB0yifyD/8pk7aY2+fuc8CORZa00tg2Enxv3cZqg0LAI=
X-Received: by 2002:a05:6512:4017:b0:4fd:fecf:5d57 with SMTP id
 br23-20020a056512401700b004fdfecf5d57mr4671503lfb.39.1693672730662; Sat, 02
 Sep 2023 09:38:50 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sat, 2 Sep 2023 09:38:50 -0700
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <83o7jr0x0v.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 01 Aug
 2023 15:25:52 +0300")
References: <5fc075c6-c94b-eacf-6bbd-7d337caa2ee7@HIDDEN>
 <83o7jr0x0v.fsf@HIDDEN>
MIME-Version: 1.0
Date: Sat, 2 Sep 2023 09:38:50 -0700
Message-ID: <CADwFkmnWLH1hXQrGka6HjU1F-q1tFZQUWP=7pzE7NmvT8KvDnA@HIDDEN>
Subject: Re: bug#64988: 30.0.50; move-to-column can move across lines if there
 is a text with display property
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64988-done
Cc: 64988-done <at> debbugs.gnu.org, geza.herman@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:

> tags 64988 notabug wontfix
> thanks
[...]
> So I'm sorry, but unless someone comes with an idea for how to handle
> these situations in a sensible way (and I thought long and hard about
> it, but couldn't find such ideas), this will remain a limitation of
> move-to-column, and one of the complications introduced by display
> strings with embedded newlines in general.  The affected packages will
> have to adapt to this change in some ways.  Since the original code
> also produced incorrect results, just different incorrect results, I
> don't see this as a serious problem, just as a bug that wasn't fixed,
> but changed its buggy behavior.

I'm therefore closing this bug report.




Notification sent to Herman, Géza <geza.herman@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Stefan Kangas <stefankangas@HIDDEN>:
You have taken responsibility. Full text available.

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


Received: (at 64988) by debbugs.gnu.org; 1 Aug 2023 14:32:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 01 10:32:30 2023
Received: from localhost ([127.0.0.1]:48159 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qQqQI-0006Hv-IF
	for submit <at> debbugs.gnu.org; Tue, 01 Aug 2023 10:32:30 -0400
Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:57437)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geza.herman@HIDDEN>) id 1qQqQH-0006Hk-I3
 for 64988 <at> debbugs.gnu.org; Tue, 01 Aug 2023 10:32:29 -0400
Received: by mail-wr1-x433.google.com with SMTP id
 ffacd0b85a97d-3178dd771ceso4245114f8f.2
 for <64988 <at> debbugs.gnu.org>; Tue, 01 Aug 2023 07:32:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1690900344; x=1691505144;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=0DuVuUPmhPf1JfUGn3hqenI166YNbTIzmA8C5nAUmcE=;
 b=LCGZUfaw/fIwQYc6EYoml2wbqRkPM2ZHePcbl+14uCkg/4oNjCSysq0QhHGieIVqaV
 YIKHjiShZN6MSo24X9II/wiKZjqOtTWpd0PZKttjR/yPmxMhXDjBy46RLYqc79RB5ncf
 b4EfqWZnV6yfiyZ9QnZ/BEc6h2tAjO/Yz7EyllxGPu1ZW+yspdv+22rj3OtijEaZrC4P
 7gm5Dmqk4AJNtmOK2h4JwyZzmGevAt8+bYRLSiBqPcJAiXfxdBAmQT7zFFo13ZAqyhJi
 ZtGHryZCAsVaH0AgXryRQNeaKYEzUV21/N46cOequG0drFJHTJ4d9N3Kyu2C4sn5RcpP
 z3Eg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1690900344; x=1691505144;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=0DuVuUPmhPf1JfUGn3hqenI166YNbTIzmA8C5nAUmcE=;
 b=kU+B1utM+vdldgE+D58riPgFYdL0C2F/ArUwB/j+O+QIi5nUS3cjcIyIVTpEfNH/Vx
 jyka0JXebwfCUerynpsUFa2tiAJkNo6fGTCgHjEE7LgbglaopNzveYxtoUZocD7LcYtF
 FDXYQVWM1BXAnb/rsStH+WikNeVo7pCQcumrUBUMBjCQW266o3PBhky6/kd88uCFoo4k
 wKt60Cg8Y7AGw0jf2hjroSDJWbZsWlWwOswfwE6NJZFDgbYS3ksCsgMQTbTgSCbZW5hN
 pE9uRHQmnkTLhcZnuYxk976D5NX9EB8/LLOu/BEsHU7JtK8cze7CkMRR6HMajbU/M7+8
 iAdg==
X-Gm-Message-State: ABy/qLZVpPRJrwt8/L9bLQRG1/wS9B8wb9UtFoSITdP3/aPy6OPg36SB
 X3kLKc2dVCvTeOCuezc9P6o=
X-Google-Smtp-Source: APBJJlFotmkjfElkwBwapcHuLPwh1nYMi9+bRgsnMqxfuYMj434FN+2f8pqMhr0z63U0CLMLwn+FDg==
X-Received: by 2002:adf:ce06:0:b0:313:fd52:af37 with SMTP id
 p6-20020adfce06000000b00313fd52af37mr2460351wrn.4.1690900343645; 
 Tue, 01 Aug 2023 07:32:23 -0700 (PDT)
Received: from [10.9.10.122] (62-77-231-86.static.invitel.hu. [62.77.231.86])
 by smtp.gmail.com with ESMTPSA id
 w10-20020a5d4b4a000000b003176c6e87b1sm15956172wrs.81.2023.08.01.07.32.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 01 Aug 2023 07:32:23 -0700 (PDT)
Message-ID: <ba172766-95ad-415c-a1d8-e28bef0315f0@HIDDEN>
Date: Tue, 1 Aug 2023 16:32:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.6.0
Subject: Re: bug#64988: 30.0.50; move-to-column can move across lines if there
 is a text with display property
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <5fc075c6-c94b-eacf-6bbd-7d337caa2ee7@HIDDEN>
 <83o7jr0x0v.fsf@HIDDEN> <f3a1359c-170e-36de-9035-e5545f677e7e@HIDDEN>
 <83jzue28ri.fsf@HIDDEN>
From: "Herman, Geza" <geza.herman@HIDDEN>
In-Reply-To: <83jzue28ri.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 64988
Cc: 64988 <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.1 (-)



On 8/1/23 15:26, Eli Zaretskii wrote:
> Copy text into a temporary buffer, remove 'display' properties, call
> move-to-column there, then move to the same position in the original
> buffer?
Yep, that's a possible solution, but I feel that it is such a basic 
functionality, emacs should be able to solve this question without using 
such workarounds. But this is just an intuition, feel free to ignore it 
:) Column-enforce-mode can be already slow for large files, if it had to 
do this copy all the time it would be even slower.

>> Regarding how to fix this problem: wouldn't it make sense to stop
>> calculating the width at the first "\n" in the displayed string?
> Stop calculating and do what?  move-to-column doesn't just calculate,
> it should move point to some place.  Where do you want to move point
> in these cases?
I understand that solving this problem if we want to stick with the 
current idea of move-to-column (meaning that it has to consider display 
properties), is hard, or even we can say that there are no good 
solutions. But ideally, it should move the cursor to the closest 
possible location in the same visual line. As far as I understand the 
intention of this function.

But for my problem, I don't think that this is the way to go. 
Column-enforce-mode should calculate columns without considering 
properties. I'd be good if emacs gave an out-of-box solution for this 
(without using copying), but if it doesn't, it's also fine.





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

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


Received: (at 64988) by debbugs.gnu.org; 1 Aug 2023 13:27:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 01 09:27:02 2023
Received: from localhost ([127.0.0.1]:47408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qQpOw-0004Tn-Bw
	for submit <at> debbugs.gnu.org; Tue, 01 Aug 2023 09:27:02 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50544)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qQpOr-0004TQ-9Y
 for 64988 <at> debbugs.gnu.org; Tue, 01 Aug 2023 09:27:01 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qQpOm-0006yD-2c; Tue, 01 Aug 2023 09:26:52 -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=o3i5InbInfJGHSQ35hM9BQnemadmmwJT4Hog6M7fn6U=; b=EeMgVZY21Xy4
 OiQubrX5ltGD50mWsepLq1KIv2W7wlgwpwW5fkKOMqN9BO41swayiT0qmN3xqH2Crg48T2CZ2oNDu
 ff9dbTKIagG8cQiJr+mbbcrUeV21xfS4TzkVogYH2VfwDLhhB5DhwoNGgpbo9nTEAokpgccL5wBSw
 exlSQi6d3ZISaOgw7i7K0gGszgMfLRwMeGXfgDfGyE5WDSjCrB3NOgy/CFMiMylBkMOK73Kr4a7at
 fXD4B62ZuXj8CD4/ss7jDJTeQb88WwZmLOWAghTtcSnq+tNHtHYXVYwMFtSlZkccvbpq/Va3zlt1G
 gflJSXDcpWiOMfKJdSzxXA==;
Received: from [87.69.77.57] (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 1qQpOl-0004J2-HU; Tue, 01 Aug 2023 09:26:51 -0400
Date: Tue, 01 Aug 2023 16:26:57 +0300
Message-Id: <83jzue28ri.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: "Herman, Geza" <geza.herman@HIDDEN>
In-Reply-To: <f3a1359c-170e-36de-9035-e5545f677e7e@HIDDEN>
 (geza.herman@HIDDEN)
Subject: Re: bug#64988: 30.0.50; move-to-column can move across lines if there
 is a text with display property
References: <5fc075c6-c94b-eacf-6bbd-7d337caa2ee7@HIDDEN>
 <83o7jr0x0v.fsf@HIDDEN> <f3a1359c-170e-36de-9035-e5545f677e7e@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64988
Cc: 64988 <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, 1 Aug 2023 14:57:29 +0200
> Cc: 64988 <at> debbugs.gnu.org
> From: "Herman, Geza" <geza.herman@HIDDEN>
> 
> I think, in my case, the move-to-column should completely ignore the 
> display property. Is there a function which does that?
> 
> I noticed this problem because how indent-bars interacts with 
> column-enforce-mode (https://github.com/jordonbiondo/column-enforce-mode).
> 
> column-enforce-mode uses move-to-column to mark long lines. And because 
> the display property with "\n" basically joins neighboring lines, 
> column-enforce-mode marks lines incorrectly.
> 
> I think it should only consider what's in the buffer, and ignore all 
> rendering related properties. Is there a way to accomplish this?

Copy text into a temporary buffer, remove 'display' properties, call
move-to-column there, then move to the same position in the original
buffer?

> Regarding how to fix this problem: wouldn't it make sense to stop 
> calculating the width at the first "\n" in the displayed string?

Stop calculating and do what?  move-to-column doesn't just calculate,
it should move point to some place.  Where do you want to move point
in these cases?

> At least, it would fix this problem, as far as I understand. Not
> sure if it breaks anything. But supposedly nothing should depend on
> the exact behavior of column calculations, if the displayed string
> contains characters after the first "\n" (because it's kind of
> undefined what the width of a multi-line string is)

When the current line is shorter than N columns, move-to-column with
the argument of N should stop at the end of the line.  But it's
impossible to do that when the newline comes from a display property.
So the correct behavior is not "undefined" in this case, it is just
impossible to achieve.




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

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


Received: (at 64988) by debbugs.gnu.org; 1 Aug 2023 12:57:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 01 08:57:39 2023
Received: from localhost ([127.0.0.1]:47384 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qQowV-0003mg-FU
	for submit <at> debbugs.gnu.org; Tue, 01 Aug 2023 08:57:39 -0400
Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:53257)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geza.herman@HIDDEN>) id 1qQowS-0003mO-Pk
 for 64988 <at> debbugs.gnu.org; Tue, 01 Aug 2023 08:57:37 -0400
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-522294c0d5bso7366770a12.2
 for <64988 <at> debbugs.gnu.org>; Tue, 01 Aug 2023 05:57:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1690894651; x=1691499451;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=H5EbNoWwsSq5zGR/GaTQY6T/xVShj1gm2tg8HL1AnFo=;
 b=G+VZtmwQ1zz74tmR8ZnHiXF/dFjdQx2w+GcmuiSFloFEHSnMXaxpV+G+Tap6wFJwFj
 QpFeil2s4G2mQTFwzcs+rDyICf3p6t/EvsoOtJJPTidlXusAh/3D4iJXRJ0F5ZO8t8Z1
 nZ7a9ZHfJ9iuwLXqPjVQ0SWfQQpWhxDs7cKNIeDpNmc5gOqRm0/9hzDdbtmCebIDAika
 Kj8X204XMyoL9NMj+SWJ+IJWUOz86MRqPGOSEIx/8PvLClhoCl6jT6cAksy03A4XDT5R
 Bcf8WycRkLolvJfau6lr9DTBC4U5lR2l5Ilq3i4rptvWp7GGXLz/XOJvAWrAZ22bSd7z
 /TxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1690894651; x=1691499451;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=H5EbNoWwsSq5zGR/GaTQY6T/xVShj1gm2tg8HL1AnFo=;
 b=OplteqfpsiJgQHIqDNXMuWzwoIpeXPoPvYWy7q/yX999+lp08GfHj2z2ZVp2xUBalh
 6I80yhUqQHGpj0TRGpSlJ0NopJg4BQ5PYcEwyWorBFYLEPanTjqXiDnSKQt9dG2JNpIO
 nKqmfh/2dQpqXeNCybgg4HDIu44uMFwnAkhVCA8CzITb2NL+OEgH90B+/FLzInYR9iL/
 WrDfJ5J7UUd3GHR5UGQce5a4KzuPaWsNjopU549IACRD9YqW45e6athiVEaCYFPekWlH
 TlL5nhgYYP6O/ES9G6dhLOvqcI5kkKzX5rG1ejoMPIP94+wtbYgpXEaegMvcKz+Qozds
 7QIw==
X-Gm-Message-State: ABy/qLZRG20idlbSCf8Ynm6Qjt8Ov/IvQIT1VIuUEZQ+ljp7MvfslXiJ
 fWZcfslY0o1Y9QBXj69K/z2QT0jRPOU=
X-Google-Smtp-Source: APBJJlFqWauwBkqNnNwr/PZIGRHUR5DAiailU0nrz/H02xBOndA9c4j8QiEvCGVM7cxGpA94IdRvEA==
X-Received: by 2002:aa7:c309:0:b0:522:6e3f:b65 with SMTP id
 l9-20020aa7c309000000b005226e3f0b65mr2334656edq.33.1690894650570; 
 Tue, 01 Aug 2023 05:57:30 -0700 (PDT)
Received: from [10.9.10.122] (62-77-231-86.static.invitel.hu. [62.77.231.86])
 by smtp.gmail.com with ESMTPSA id
 y23-20020aa7c257000000b005226f281bc5sm6817054edo.25.2023.08.01.05.57.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 01 Aug 2023 05:57:30 -0700 (PDT)
Message-ID: <f3a1359c-170e-36de-9035-e5545f677e7e@HIDDEN>
Date: Tue, 1 Aug 2023 14:57:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.6.0
Subject: Re: bug#64988: 30.0.50; move-to-column can move across lines if there
 is a text with display property
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <5fc075c6-c94b-eacf-6bbd-7d337caa2ee7@HIDDEN>
 <83o7jr0x0v.fsf@HIDDEN>
From: "Herman, Geza" <geza.herman@HIDDEN>
In-Reply-To: <83o7jr0x0v.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 64988
Cc: 64988 <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.1 (-)

I think, in my case, the move-to-column should completely ignore the 
display property. Is there a function which does that?

I noticed this problem because how indent-bars interacts with 
column-enforce-mode (https://github.com/jordonbiondo/column-enforce-mode).

column-enforce-mode uses move-to-column to mark long lines. And because 
the display property with "\n" basically joins neighboring lines, 
column-enforce-mode marks lines incorrectly.

I think it should only consider what's in the buffer, and ignore all 
rendering related properties. Is there a way to accomplish this?

Regarding how to fix this problem: wouldn't it make sense to stop 
calculating the width at the first "\n" in the displayed string? At 
least, it would fix this problem, as far as I understand. Not sure if it 
breaks anything. But supposedly nothing should depend on the exact 
behavior of column calculations, if the displayed string contains 
characters after the first "\n" (because it's kind of undefined what the 
width of a multi-line string is)

On 8/1/23 14:25, Eli Zaretskii wrote:
> tags 64988 notabug wontfix
> thanks
>
>> Date: Tue, 1 Aug 2023 12:53:57 +0200
>> From: Herman <at> debbugs.gnu.org, Géza <geza.herman@HIDDEN>
>>
>> If there is a text with display property in a buffer, then
>> move-to-column can move across lines.
>>
>> Repro:
>> * emacs -Q
>> * in the scratch buffer, move the cursor to the top, and put an empty
>> line at the beginning of the buffer
>> * execute 'M-: (put-text-property 1 2 'display "line\n")' (note: it's
>> likely that the "\n" causes the problem)
>> * notice that the empty line becomes "line"
>> * while the cursor still on the first line, execute 'M-: (move-to-column
>> 20)'
>>
>> The last command will move the cursor to the next line at column 16,
>> instead of staying at the first line.
>>
>> Note: I noticed this problem while using this package:
>> https://github.com/jdtsmith/indent-bars.
>>
>> The problem doesn't happen with emacs 28, this is the commit that
>> introduced the issue:
>>
>> 4243747b1b8c3b7e3463822804b32e83febe2878 Fix 'current-column' in the
>> presence of display strings
> This is a known issue, but it is not a bug, at least not one we know
> how to "fix".  In general, move-to-column cannot work correctly when
> display strings with embedded newlines are involved, because Emacs
> cannot place the cursor at the newline in the middle of such a display
> string.
>
> The commit to which you point fixed current-column to correctly report
> the column where such display strings are involved, at least in the
> important cases.  That move-to-column changed behavior in those cases
> is unfortunate, but I couldn't find any sensible way of dealing with
> these cases, because the correct result -- setting the cursor after
> the newline embedded in the display string, because column 20 doesn't
> exist on that line -- is impossible.  (The result that you expected,
> which was what Emacs 28 did, i.e. for the cursor to stay at buffer
> position 1, is also incorrect, since that position is column 1, not
> column 20 and not the last column visible on that line.)
>
> So I'm sorry, but unless someone comes with an idea for how to handle
> these situations in a sensible way (and I thought long and hard about
> it, but couldn't find such ideas), this will remain a limitation of
> move-to-column, and one of the complications introduced by display
> strings with embedded newlines in general.  The affected packages will
> have to adapt to this change in some ways.  Since the original code
> also produced incorrect results, just different incorrect results, I
> don't see this as a serious problem, just as a bug that wasn't fixed,
> but changed its buggy behavior.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64988; Package emacs. Full text available.
Added tag(s) notabug and wontfix. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 64988) by debbugs.gnu.org; 1 Aug 2023 12:25:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 01 08:25:57 2023
Received: from localhost ([127.0.0.1]:47377 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qQoRo-0000Mq-W9
	for submit <at> debbugs.gnu.org; Tue, 01 Aug 2023 08:25:57 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37952)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1qQoRn-0000MZ-5G; Tue, 01 Aug 2023 08:25:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qQoRh-0000AP-Cm; Tue, 01 Aug 2023 08:25:49 -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=dDnFp/pd3aOX1g64XVhaQZxyIJV1oYo6oYfNxYwEack=; b=Fw2iJ5u0hGJi2YsJXE3L
 7c79c1pMsHM8MnsRHITKMamrcBEGGnJhRN3z4LLL6ayxI8nLaoB9XC8TVfQmLw8rBNIBG3y8aIrkf
 4JT9m/3UOWMZpikb9hf+0uWD2TaTzlQtYAdg8WAu7ZBG81b44iNI1z6KkQL1+yimfOfSkDgIDlULj
 ShX9RX8QZeiJLd4zxcQyIimeRfc6lySiCGBqXs9ihTbIKpAL3mLodxZzAfs+yTsj366rh5pKa1cG+
 QoQyk5j4TWv5ClwP2+/60oxWipFBFEdZJ31jHYfltQEWbCGpFzJ/xJvItbB3DrNbRTaRcuRr/Qmxz
 cW9uFWcPdiTPAA==;
Received: from [87.69.77.57] (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 1qQoRg-0006gq-Om; Tue, 01 Aug 2023 08:25:49 -0400
Date: Tue, 01 Aug 2023 15:25:52 +0300
Message-Id: <83o7jr0x0v.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?Herman=2C_G=C3=A9za?= <geza.herman@HIDDEN>
In-Reply-To: <5fc075c6-c94b-eacf-6bbd-7d337caa2ee7@HIDDEN>
 (Herman <at> debbugs.gnu.org)
Subject: Re: bug#64988: 30.0.50;
 move-to-column can move across lines if there is a text with display
 property
References: <5fc075c6-c94b-eacf-6bbd-7d337caa2ee7@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: 64988
Cc: 64988 <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 (---)

tags 64988 notabug wontfix
thanks

> Date: Tue, 1 Aug 2023 12:53:57 +0200
> From: Herman <at> debbugs.gnu.org, Géza <geza.herman@HIDDEN>
> 
> If there is a text with display property in a buffer, then 
> move-to-column can move across lines.
> 
> Repro:
> * emacs -Q
> * in the scratch buffer, move the cursor to the top, and put an empty 
> line at the beginning of the buffer
> * execute 'M-: (put-text-property 1 2 'display "line\n")' (note: it's 
> likely that the "\n" causes the problem)
> * notice that the empty line becomes "line"
> * while the cursor still on the first line, execute 'M-: (move-to-column 
> 20)'
> 
> The last command will move the cursor to the next line at column 16, 
> instead of staying at the first line.
> 
> Note: I noticed this problem while using this package: 
> https://github.com/jdtsmith/indent-bars.
> 
> The problem doesn't happen with emacs 28, this is the commit that 
> introduced the issue:
> 
> 4243747b1b8c3b7e3463822804b32e83febe2878 Fix 'current-column' in the 
> presence of display strings

This is a known issue, but it is not a bug, at least not one we know
how to "fix".  In general, move-to-column cannot work correctly when
display strings with embedded newlines are involved, because Emacs
cannot place the cursor at the newline in the middle of such a display
string.

The commit to which you point fixed current-column to correctly report
the column where such display strings are involved, at least in the
important cases.  That move-to-column changed behavior in those cases
is unfortunate, but I couldn't find any sensible way of dealing with
these cases, because the correct result -- setting the cursor after
the newline embedded in the display string, because column 20 doesn't
exist on that line -- is impossible.  (The result that you expected,
which was what Emacs 28 did, i.e. for the cursor to stay at buffer
position 1, is also incorrect, since that position is column 1, not
column 20 and not the last column visible on that line.)

So I'm sorry, but unless someone comes with an idea for how to handle
these situations in a sensible way (and I thought long and hard about
it, but couldn't find such ideas), this will remain a limitation of
move-to-column, and one of the complications introduced by display
strings with embedded newlines in general.  The affected packages will
have to adapt to this change in some ways.  Since the original code
also produced incorrect results, just different incorrect results, I
don't see this as a serious problem, just as a bug that wasn't fixed,
but changed its buggy behavior.




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

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


Received: (at submit) by debbugs.gnu.org; 1 Aug 2023 10:54:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 01 06:54:10 2023
Received: from localhost ([127.0.0.1]:47233 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qQn10-0003pK-01
	for submit <at> debbugs.gnu.org; Tue, 01 Aug 2023 06:54:10 -0400
Received: from lists.gnu.org ([2001:470:142::17]:46604)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geza.herman@HIDDEN>) id 1qQn0y-0003p7-Jr
 for submit <at> debbugs.gnu.org; Tue, 01 Aug 2023 06:54:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geza.herman@HIDDEN>)
 id 1qQn0t-0007RR-DS
 for bug-gnu-emacs@HIDDEN; Tue, 01 Aug 2023 06:54:03 -0400
Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <geza.herman@HIDDEN>)
 id 1qQn0r-0001D3-Tg
 for bug-gnu-emacs@HIDDEN; Tue, 01 Aug 2023 06:54:03 -0400
Received: by mail-wm1-x32f.google.com with SMTP id
 5b1f17b1804b1-3fbc244d384so51005055e9.0
 for <bug-gnu-emacs@HIDDEN>; Tue, 01 Aug 2023 03:54:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1690887239; x=1691492039;
 h=content-transfer-encoding:subject:from:to:content-language
 :user-agent:mime-version:date:message-id:from:to:cc:subject:date
 :message-id:reply-to;
 bh=+rxyGHOTHDFDVmeiZXORqSv+w9YC5+Wgg9mbq3/UQAU=;
 b=H9Qp4bm3WfTE+Suy9L1tFCbaHKQtDVqCvLvyrtvfuoTmN7dEO0gxRq6RPIBO1npPUw
 PG0QKBWSg+Ee2s8yyIfRg6KD2srNMH3EI6M5N9FqhWft3ntWOhORct02NsnRaR6r1vmM
 +amWHtaZJmN1tw78/F/DnYBSZVbqc7nKsHc4UE5mDyQe9jmV2szIHuUINempAczYPato
 g5UHP/6B+J0SGnESUUOayorXZw2kIk3kFNH/cMhtWeHDRZLKmC5/+9/bA3ALpiHLyigA
 Bl4ZcZSE5gMCoHuLg8aX2Q0iKIyaDlanXE+3OgUkuq7pEK18vVZ79l+WeBBEE4IiCez8
 t9LA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1690887239; x=1691492039;
 h=content-transfer-encoding:subject:from:to:content-language
 :user-agent:mime-version:date:message-id:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=+rxyGHOTHDFDVmeiZXORqSv+w9YC5+Wgg9mbq3/UQAU=;
 b=lMpGakXWi+lqB+jnPfErccmCteJ1QrsBbuLjoyT/snFimDiPmEcccH+rkSYv1LemK+
 xCMcI8xaOMhmc4D1iqKAFlmeb3Addt04Dqwrth2yDLkP4la95d3D64Sz1xKWKjARNIi2
 By6xX8cvT/sEQizInVns89p3I2mB/hAc9cjekbMMK7gXwwFnh5tN0VLidz+T0Yti8hPV
 TDaAE2W78BJeWnCmw5U8CLakeaLmAHsiJO4bCIwHHUWUUQpnq0svZeMWdXZJ/nIbLrHj
 rg0MFgWsBbaL7M4OLum9Bcj4g61s3WAWHIW8n9PZzY/SlYTMJSdr/U9hL9HPWdrUc0QB
 tm7w==
X-Gm-Message-State: ABy/qLZyVBVOu1YPQIpOeofN6hEoizoVnYDtv9vCNnxn0ds3gv+VJ1nS
 GMObewqUbfrQFDx65XUFZJVE0ew8hsU=
X-Google-Smtp-Source: APBJJlG7YTUeKX3n6dWDxJcCdpG8t9Ls07CB0+o0KfwY5B2+h1236eqMQinITaSJeRzjBFA9e+S/BQ==
X-Received: by 2002:a05:600c:2213:b0:3fe:2102:8083 with SMTP id
 z19-20020a05600c221300b003fe21028083mr1897710wml.26.1690887238985; 
 Tue, 01 Aug 2023 03:53:58 -0700 (PDT)
Received: from [192.168.8.4] (netacc-gpn-104-254-79.pool.yettel.hu.
 [91.104.254.79]) by smtp.gmail.com with ESMTPSA id
 f17-20020adffcd1000000b00313f61889ecsm15862847wrs.66.2023.08.01.03.53.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 01 Aug 2023 03:53:58 -0700 (PDT)
Message-ID: <5fc075c6-c94b-eacf-6bbd-7d337caa2ee7@HIDDEN>
Date: Tue, 1 Aug 2023 12:53:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.2.1
Content-Language: sv-FI
To: bug-gnu-emacs@HIDDEN
From: =?UTF-8?Q?Herman=2c_G=c3=a9za?= <geza.herman@HIDDEN>
Subject: 30.0.50; move-to-column can move across lines if there is a text with
 display property
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=2a00:1450:4864:20::32f;
 envelope-from=geza.herman@HIDDEN; helo=mail-wm1-x32f.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

If there is a text with display property in a buffer, then 
move-to-column can move across lines.

Repro:
* emacs -Q
* in the scratch buffer, move the cursor to the top, and put an empty 
line at the beginning of the buffer
* execute 'M-: (put-text-property 1 2 'display "line\n")' (note: it's 
likely that the "\n" causes the problem)
* notice that the empty line becomes "line"
* while the cursor still on the first line, execute 'M-: (move-to-column 
20)'

The last command will move the cursor to the next line at column 16, 
instead of staying at the first line.

Note: I noticed this problem while using this package: 
https://github.com/jdtsmith/indent-bars.

The problem doesn't happen with emacs 28, this is the commit that 
introduced the issue:

4243747b1b8c3b7e3463822804b32e83febe2878 Fix 'current-column' in the 
presence of display strings





Acknowledgement sent to Herman, Géza <geza.herman@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#64988; 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: Sun, 5 Nov 2023 06:15:02 UTC

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