Subject: Re: bug#72420: set-goal-column misbehaves with a line-prefix and visual-line-mode

From: Eli Zaretskii <[email-masked]>
Date: Wed, 07 Aug 2024 14:01:18 +0300

tags 72420 notabug
thanks

> From: "Martin Edstrom" <[email-masked]>
> CC: "72420" <[email-masked]>
> Date: Tue, 06 Aug 2024 16:10:09 +0200 (CEST)
> 
> Alright, I keep being mistaken about the reproducibility of my bug reports, but I'm reasonably sure the following steps are reproducible.

I think they are, thanks.

> Step 3: Run M-x visual-line-mode.

Note: I get the same behavior without visual-line-mode, so I think
this Step 3 is not needed.

> Step 4: Move point to "z", inside the last line, and type C-x C-n (set-goal-column). Say yes to the disabled-command prompt.
> 
> Now I would expect moving point upwards with C-p any number of times should still make point land on the text after the list bullet, but the goal column actually seems to be offset in some way influenced by the line prefix. Even using C-n to come back to the line that has "z....." does not place point on the same position as when you started out.

Yes, the column is offset by the line-prefix, because line-prefix is
not considered to be part of the text-area.  You can see this already
when you type "C-x C-n" in Step 4: Emacs says the column at "z" is 2,
not 6.

This is the intended behavior, so there's no bug here.