]> git.notmuchmail.org Git - notmuch/commit - emacs/notmuch-tree.el
emacs: avoid binding unnamed commands in keymaps
authorJonas Bernoulli <jonas@bernoul.li>
Mon, 16 Nov 2020 21:28:42 +0000 (22:28 +0100)
committerDavid Bremner <david@tethera.net>
Sun, 6 Dec 2020 20:23:38 +0000 (16:23 -0400)
commitadfded9ed0a5a4b06886f462314cd4511cb72d47
treed91fde6c90c4199a39af3dc1ce473e4bd7ddf52c
parent54492ddf235f81d4b3f1b3ffbdd2aeedd0279b92
emacs: avoid binding unnamed commands in keymaps

One should never bind unnamed commands in keymaps because doing that
makes it needlessly hard for users to change these bindings.

Replace such anonymous bindings with named commands that are generated
using macros and some boilerplate. Using macros is better than using a
simple loop because that makes it possible for `find-function' to find
the definitions. Eat your boilerplate--it forms character.

Admittedly this approach is quite ugly and it might be better to teach
the original commands to support different buffers directly instead of
requiring wrapper commands to do just that.

Never-the-less as a short-term solution this is better than what we
had before.
emacs/notmuch-tree.el