If I can find out which keys I used most, I may create a macro for it; if I can find out which function I used most yet not binded, I can bind it to a key. This may improve efficiency. Is there a way to get these statistics knowledge?

3 Answers 3


smex users

If you use smex, the smex-show-unbound-commands command does exactly that; show the commands that you use frequently using M-x (the suggested smex binding) but have yet to be bound to a key binding.

  • Ha, added the same answer at the same time. I'l just +1 yours and drop mine.
    – glucas
    Dec 29, 2014 at 15:29
  • @glucas: good karma for good sportsmanship!
    – Dan
    Dec 29, 2014 at 15:31

I used to use keyfreq. It was good, but eventually I switched it off and went back to using my intuition.


You can view the last 300 keystrokes with C-h l calling the view-lossage function. Inspect the displayed buffer to see what 300 keys you last hit.

If you call describe-function then view-lossage you will see that you can also use the open-dribble-file function to start writing (record) all characters you type to a file.

  • (-1) 1. 300 is hard-coded (in function recent-keys). It is not just a default value. 2. C-h l does not tell you anything about "what keys you hit the most". It tells you only what the last 300 keys you used were.
    – Drew
    Dec 29, 2014 at 16:52
  • @Drew Answer edited.
    – Nsukami _
    Dec 29, 2014 at 17:39
  • (+1) Looks better. Glad you mentioned open-dribble-file.
    – Drew
    Dec 29, 2014 at 17:41
  • stackoverflow.com/questions/9761401/… may also be of interest.
    – phils
    Dec 31, 2014 at 8:04

Your Answer

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

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