(setq unread-command-events
(listify-key-sequence (this-command-keys-vector)))
[ Ideally, you should not assume that unread-command-events was nil. ]
No, but I was unsure how to add to the list ...
The missing bit that lead to the looping was setting last-command-char
to nil.
Maybe something like this could be included in the manual in
(info "(elisp) Event Input Misc")?
I'd rather fix whichever code is responsible for the inf-loop.
Can you provide a recipe to reproduce the problem?
Maybe I can provide a simple recipe, but I think there probably is nothing
to fix. I believe the looping I saw was because of the way Viper is
written. When you do something like d, y, c etc then `last-command-char'
will be used. (Of course other commands may do similar things, there is
nothing wrong with it AFAICS.)
An inf-loop is a bug. And I have a hard time imagining why
(setq last-command-char nil) would be The Right Fix(TM) (it might be an
OK fix if you don't have access to the rest of the code, tho).