Subject: Re: bug#16181: 23.1; losing track of point

From: "Chandler, John" <[email-masked]>
Date: Sun, 30 May 2021 15:23:39 -0400

On Sun, May 30, 2021 at 1:26 AM Lars Ingebrigtsen <[email-masked]> wrote:
>
> John Chandler <[email-masked]> writes:
>
> > The following macro is a short example:
> >
> > (defun ttt() "add tag from start" (interactive)
> >   (save-excursion
> >     (goto-char 0)
> >     (copy-to-register 26 (point) (progn (forward-word 1)(point)) t))
> >   (insert-register 26)
> >   (forward-line 1))
> >
> > The file to be edited using this macro should begin with a line
> > containing a list of words to be inserted in front of a succession of
> > lines in the file.  If the lines in the file generally wrap,
> > especially if they wrap multiple times each, the successive
> > application of the macro should quickly trigger the bug.

The bug is intermittent and seems to depend on the exact alignment
of the display when (point) moves out of the current window.  I found
a 99% reliable workaround by inserting lots of (sit-for) invocations into
complicated macros.  For the same reason, the above macro triggers the
bug only if it is invoked multiple times within another macro, and not when
it's invoked by hand (except rarely).  Meanwhile, I see the bug still
happening in emacs 22.2.1 and 23.1.1, but apparently not in 24.3.1,
so I guess it's fixed.

John Chandler