Subject: Re: bug#23903: 25.0.95; Undo after keyboard shortcuts differs from undo after M-x ... RET

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 02 Dec 2020 12:45:59 +0100

Markus Triska <[email-masked]> writes:

> With the latest emacs-25 git, please do the following:
>
> 1) Invoke Emacs via:
>
>     emacs -Q --eval "(defun bc () (interactive)\
>                          (start-process \"bc\" (current-buffer) \"bc\"))" \
>           --eval "(global-set-key [f9] 'bc)" \
>           --eval "(save-excursion (insert \"hello\"))"
>
> 2) Press (F9 is bound to the function bc by the snippet above):
>
>    F9 C-/
>
>    After undo, point is at the beginning of the buffer, as expected.
>
> 3) Press:
>
>    M-x bc RET C-/
>
>    After undo, point is unexpectedly at the end of the buffer instead.

(This bug report unfortunately got no response at the time.)

Thanks for a clear recipe for reproducing this bug.

I can confirm that this behaviour is still present in Emacs 28.  Does
anybody have any insight into why this may be happening (before I start
trying to debug it)?  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no