Subject: bug#21867: 25.0.50; lossage's log doesn't treat characters read by read-char as separate commands

From: Juri Linkov <[email-masked]>
Date: Mon, 05 Aug 2019 00:04:25 +0300

>>   Command: last-kbd-macro
>>   Key: none
>>
>>   Macro:
>>
>>   C-x C-e                 ;; eval-last-sexp
>>   a                       ;; self-insert-command
>
> Hm...  well, that's a spanner in the works.
>
> Is `edit-last-kbd-macro' just wrong here?  Because that "a" isn't really
> a `self-insert-command', surely.

A similar problem is complained about in the comments of lisp/repeat.el:

;; This works correctly inside a keyboard macro as far as recording and
;; playback go, but `edit-kbd-macro' gets it wrong.  That shouldn't really
;; matter; if you need to edit something like
;;   C-x ]              ;; forward-page
;;   C-x z              ;; repeat
;;   zz                 ;; self-insert-command * 2
;;   C-x                ;; Control-X-prefix
;; you can just kill the bogus final 2 lines, then duplicate the repeat line
;; as many times as it's really needed.  Also, `edit-kbd-macro' works
;; correctly if `repeat' is invoked through a rebinding to a single keystroke
;; and the global variable repeat-on-final-keystroke is set to a value
;; that doesn't include that keystroke.