I’m going to do periodic analysis of my Emacs use, to better determine how I might more efficiently use it. I expect the frequency of command to change dramatically every few months, as what I use emacs for changes. For example, right now I mostly use emacs for writing blog posts, customizing emacs itself, and a small amount of programming that I do on my free time. This will no doubt change when I go back for my school term and will have many more programming projects.
To analyze my frequency, I need to keep track of what commands I am executing. Searching around found the comnmand-frequency package, originally used to develop an ergonomic keybinding set for emacs. This package can be found here. To enable command tracking, put the following in your initialization file:
(setq-default command-frequency-table-file "~/.emacs.d/frequencies") (require 'command-frequency) (command-frequency-table-load) (command-frequency-mode 1) (command-frequency-autosave-mode 1)
This will make the command frequency tracking persistent across your emacs sessions, as well. If you want this to happen, you need to set the command-frequency-table-file before loading the table and do that before enabling autosave-mode; otherwise, as I’ve found out, you’ll probably lose your old history. There are a few additional customizations you can make to specify where various files are saved and what format they are written in, but I find this sufficient.
Once you’re enabled command-frequency-mode, it’s very simple to use. M-x command-frequency will take you to a buffer showing the relative frequencies of all your commands. M-x command-frequency-insert will insert this table into the current document. M-x write-file will *theoretically* write this information to a file, but unless called non-interactively it fails for me. I haven’t fixed this, since I haven’t ever had a need for it, but it would probably be a relatively simple fix.