2

I'm curious if there is a mechanism for determining whether a keybinding is a stock (default) keybinding within Emacs (or a particular package). Whenever I mention a command to someone I generally need to check whether what I use is the default. (It would be great to have a visual indication of the customization in the describe-key/describe-key-briefly output!)

Given the basic structure of keymaps I imagine that it isn't possible to judge the modification state from the keymaps themselves. I think it would be necessary to attach advice to define-key prior to customizations and then simply track them.

1

It turns out that bind-key does almost exactly this! describe-personal-keybindings displays a listing of all customizations made using bind-key (but not define-key directly). I guess I'm going to remove all uses of define-key in my init now.

Custom bindings are tracked in personal-keybindings and per the docstring have the following structure:

((KEY . [MAP]) CMD ORIGINAL-CMD)

Now to customize the describe-key/describe-key-briefly output...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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