From 83fbc7a13ebf126b7d0f93cece9d6d27c6f6a9fe Mon Sep 17 00:00:00 2001 From: Maximilian Wolff Date: Sun, 15 Mar 2020 23:58:23 +0100 Subject: [PATCH] [notmuch] Improve evilification and documentation notmuch-hello was using an evilified buffer which broke the embedded search widget in the buffer. I have changed the evilification to using normal mode with manual bindings instead. In addition I have made the notmuch message buffer closable using "q" and added the missing notmuch-hello keybindings to the docs. --- layers/+email/notmuch/README.org | 18 ++++++++++++++---- layers/+email/notmuch/packages.el | 28 +++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/layers/+email/notmuch/README.org b/layers/+email/notmuch/README.org index 320390a16..f157e28e2 100644 --- a/layers/+email/notmuch/README.org +++ b/layers/+email/notmuch/README.org @@ -132,10 +132,20 @@ Refer to the official notmuch website for more information: ** Evilified key bindings *** Hello mode -| Key binding | Command | -|-------------+-----------------------------| -| ~J~ | Jump to a saved search | -| ~s~ | Show threads matching QUERY | +| Key binding | Command | +|-------------+--------------------------------------| +| ~TAB~ | Jump to next widget | +| ~S-TAB~ | Jump to previous widget | +| ~J~ | Jump to a saved search | +| ~s~ | Show threads matching QUERY | +| ~=~ or ~g~ | Refresh buffer | +| ~M-=~ | Refresh all open notmuch buffers | +| ~?~ | Open notmuch help buffer | +| ~G~ | Pull new messages and refresh buffer | +| ~m~ | Open new mail buffer | +| ~q~ | Kill notmuch buffer | +| ~v~ | Show current notmuch version | +| ~z~ | Open notmuch tree buffer | *** Search mode diff --git a/layers/+email/notmuch/packages.el b/layers/+email/notmuch/packages.el index f73ed929b..461796b92 100644 --- a/layers/+email/notmuch/packages.el +++ b/layers/+email/notmuch/packages.el @@ -16,8 +16,8 @@ notmuch org persp-mode - window-purpose - )) + window-purpose)) + (defun notmuch/init-counsel-notmuch () (use-package counsel-notmuch @@ -80,9 +80,27 @@ "Po" 'spacemacs/notmuch-show-open-github-patch "Pa" 'spacemacs/notmuch-git-apply-patch "PA" 'spacemacs/notmuch-git-apply-patch-part) - ;; evilified maps - (evilified-state-evilify-map notmuch-hello-mode-map - :mode notmuch-hello-mode) + ;; Evilify notmuch modes + ;; Use normal mode map to allow proper editing capabilities + ;; for the embedded search field in `notmuch-hello-mode` + (evil-set-initial-state 'notmuch-hello-mode 'normal) + (evil-define-key 'normal notmuch-hello-mode-map + "C-tab" #'widget-backward + "S-tab" #'widget-backward + "=" #'notmuch-refresh-this-buffer + "?" #'notmuch-help + "G" #'notmuch-poll-and-refresh-this-buffer + "g" #'notmuch-refresh-this-buffer + "J" #'notmuch-jump-search + "m" #'notmuch-mua-new-mail + "q" #'notmuch-bury-or-kill-this-buffer + "s" #'notmuch-search + "v" #'notmuch-hello-versions + "z" #'notmuch-tree + "M-=" #'notmuch-refresh-all-buffers) + ;; Make notmuch message mode exitable with q + (evil-define-key 'normal notmuch-message-mode-map + "q" #'message-kill-buffer) (evilified-state-evilify-map notmuch-show-mode-map :mode notmuch-show-mode :bindings