[PATCH] Fix notmuch-describe-key
marmstrong at google.com
Tue Mar 5 09:28:41 PST 2019
Sheng Yang <yangsheng6810 at gmail.com> writes:
> Matt Armstrong <marmstrong at google.com> writes:
>> I think it would be great if someone worked with upstream Emacs to make
>> the `documentation' function do something useful for evil mode and
>> spacemacs. If that happened, then all packages would benefit. Porting
>> things like counsel-descbinds into packages like notmuch can work but
>> does not feel like the right long term solution to me.
> I guess the problem does not come from `documentation' function itself.
> I will investigate a bit more.
> What if we filter the key bindings and show only those that are binded
> to notmuch functions? Maybe those functions that matches "^notmuch-"?
> This only shows related key bindings related to notmuch, and the list
> would not be long anyway.
Yes, that could be a practical and pragmatic solution. I do not oppose
it, but see my one note about this below.
I suggested improving core Emacs help functions earlier simply because I
think the core help system should be better, which would reduce the
reasons we see packages like notmuch and counsel trying to do a better
job. For example, if core Emacs understood the approaches taken by
evil-mode to bind keys it could do a better job with help. Emacs help
already does a "bad" job with other modal key maps (e.g. the help for
the ESC key is displayed as an almost useless "Prefix Command" by Emacs
Improving all this is a long term solution -- any fix to Emacs itself
takes years to be available to everyone.
But take M-x describe-mode in a notmuch-search buffer. It shows me the
list below. Clearly the original intent of the notmuch help functions
were to make that more useful, but something is going wrong in the
I'm not sure why. Emacs lisp is so flexible that anything could be
happening. For example, spacemacs could be installing advice around the
`documentation' function that modifies the behavior in a way that makes
sense for spacemacs but confuses the notmuch code. I am not sure why so
many spacemacs bindings see to be in the notmuch key maps. Who knows.
One problem with filtering the command list is shown below. I have
bound a command of my own, my-notmuch-search-mute-thread, to the key
map. I find it useful to have that included in the help output.
ESC Prefix Command
c ? notmuch-subkeymap-help
c i notmuch-search-stash-thread-id
c q notmuch-stash-query
More information about the notmuch