Subject: Re: bug#23551: 24.5; beginning-of-line wrong in repeated kbd macro

From: Eli Zaretskii <[email-masked]>
Date: Sat, 28 May 2016 18:38:53 +0300

> Date: Mon, 16 May 2016 20:30:29 +0300
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked]
> 
> > Date: Mon, 16 May 2016 16:30:32 +0000
> > From: [email-masked]
> > Cc: Abbott John <[email-masked]>
> > 
> > Open the attached file in Emacs, and move point to the first position.
> > Define a keyboard macro: (I want to put each line inside double-quotes)
> > "			;; self-insert-command
> > C-e			;; move-end-of-line
> > "			;; self-insert-command
> > C-a			;; message-beginning-of-line
> > <down>			;; next-line
> > 
> > Now ask Emacs to repeat this macro 49 times.
> > The result is wrong: at around line 35, the first double-quote
> > is no longer at the start of the line; then on successive lines
> > the position of the first inserted double-quote walks to the right.
> 
> Thanks.
> 
> This is a duplicate of the (old, but unsolved) bug #13452.  The
> problem is not in beginning-of-line, it's in next-line: when the
> window needs to scroll as result of next-line, point ends up in
> columns 1, 2, 3, ... (i.e. gains one column per line moved down),
> instead of sticking to column zero.
> 
> To work around, set line-move-visual to nil before running the macro
> (or as part of the macro), then the problem goes away.
> 
> I'll try to debug this one of these days.

Should be fixed now, please test the latest Emacs master branch.