programming musings
13 May 2020

unlearn

For years, i've been using C-x p, C-x o and C-c <n> to move to other windows, but with ace window i am substituting all of them with M-o. Problem is, muscle memory interferes and i find myself clumsily moving around (and often lost) with the former ones. Or i did, before i followed an advice from Stefan Monnier in emacs-devel: unbind those keys you want to forget, and you'll get an error when you relapse.

In my case, that was just

(global-set-key (kbd "C-x o") nil)

together with commeting out the other one's definitions. For the record, in Stefan's case, he was trying to remember to use the newer C-h o (symbol help) instead of C-h f (function help) or C-h v (variable help), so he unbound the last two.

After a while, when one's muscles have forgotten, one can re-enable the old bindings, for the few cases where they're justified.

Tags: emacs programming
Creative Commons License
jao.io by jao is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.