this-command-keys and this-command-keys-vector return the entire key sequence that fired the current command. However, such sequence will contain any prefix argument, too. Is there a function or variable - let's call it this-command-key-binding - to get just the key sequence for the command, without any prefix, so that (key-binding (this-command-binding)) returns the same value as this-command, even in the presence of a prefix argument?

1 Answer 1


I think you're looking for this-single-command-keys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.