Subject: Re: bug#64988: 30.0.50; move-to-column can move across lines if there is a text with display property

From: "Herman, Geza" <[email-masked]>
Date: Tue, 1 Aug 2023 16:32:22 +0200

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.