> Inherently, changing `real-last-command' is not "nice". > > I wasn't thinking of changing it; rather, not setting it at all for > those kinds of events. I meant "changing the semantics of `real-last-command'". We'd change the semantics by _not_ setting it. > That probably works in practice, because the only other package > that tests `real-last-command' is table.el, and I think it could > just as well use `last-command'. Yes. But if we were to suggest not testing `real-last-command' in Lisp code (aside from repeat.el) we probably shouldn't mention that variable in the manual in the first place. > But you are right that this isn't entirely clean. > What could be a cleaner method? > > Perhaps to make a new variable and set it at the C level, almost like > `real-last-command' but excluding certain commands, or certain events. We could call it `last-repeatable-command' and have repeat.el use that instead of `real-last-command'. I attached a patch for keyboard.c. > Disregarding my scruples, how do I tell whether `real-this-command' was > bound to an input event at the time of executing > > current_kboard->Vreal_last_command = real_this_command; > > My idea was to test last_command_char. We maybe should say somewhere that it's a bad idea to change `last-command-char' (and probably `real-last-command' and `last-repeatable-command' as well) while executing a command.