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

From: "Martin Edstrom" <[email-masked]>
Date: Wed, 07 Aug 2024 14:07:45 +0200 (CEST)

But, it's odd that visual-line-mode does not affect it for you - it does for me. 

If I leave visual-line-mode off, then I get the behavior I expect (i.e. set-goal-column at column 2 is treated as column 6), which is useful.  Turning it on causes the command to behave in a way that is not useful, as I described.

Martin Edstrom

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

> 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.