From 16e14ea9c58aa1224c09d02e40ad3edde72c820a Mon Sep 17 00:00:00 2001 From: Gerry Agbobada <10496163+gagbo@users.noreply.github.com> Date: Thu, 24 Dec 2020 17:47:20 +0100 Subject: Put notmuch-common-keymap last Since all the other maps in `evil-collection-notmuch-maps` have notmuch-common-keymap as parent https://git.notmuchmail.org/git?p=notmuch;a=blob;f=emacs/notmuch-hello.el;h=fa31694ff0f79a7f2781849394390a673f75aade;hb=HEAD#l651 When `evil-collection-setup-hook` runs, if it changes keymaps using a `dolist` over `evil-collection-notmuch-maps`, then a binding might see 2 changes at once. See discussion here https://github.com/hlissner/doom-emacs/pull/4403#issuecomment-750907188 --- modes/notmuch/evil-collection-notmuch.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modes/notmuch/evil-collection-notmuch.el b/modes/notmuch/evil-collection-notmuch.el index ad70dfb..0151396 100644 --- a/modes/notmuch/evil-collection-notmuch.el +++ b/modes/notmuch/evil-collection-notmuch.el @@ -36,13 +36,20 @@ (declare-function notmuch-search-tag "notmuch") (declare-function notmuch-tree-tag "notmuch-tree") -(defconst evil-collection-notmuch-maps '(notmuch-common-keymap - notmuch-hello-mode-map +;; Since all the other maps in `evil-collection-notmuch-maps` +;; have notmuch-common-keymap as parent +;; https://git.notmuchmail.org/git?p=notmuch;a=blob;f=emacs/notmuch-hello.el;h=fa31694ff0f79a7f2781849394390a673f75aade;hb=HEAD#l651 +;; +;; When `evil-collection-setup-hook` runs, if it changes keymaps +;; using a `dolist` over `evil-collection-notmuch-maps`, then a binding might +;; see 2 changes at once. To avoid that, notmuch-common-keymap is last +(defconst evil-collection-notmuch-maps '(notmuch-hello-mode-map notmuch-show-mode-map notmuch-show-part-map notmuch-tree-mode-map notmuch-search-mode-map - notmuch-search-stash-map)) + notmuch-search-stash-map + notmuch-common-keymap)) (defun evil-collection-notmuch-toggle-tag (tag mode &optional next-function) "Toggle TAG tag for message in MODE." -- cgit v1.0