Skip to content

Commit

Permalink
notmuch: fix RET keybinding in notmuch-hello-mode.
Browse files Browse the repository at this point in the history
In the previous version, pressing "RET" (i.e., calling
`evil-collection-notmuch-hello-ret`) on a recent search to enter a
search mode buffer, then pressing `q` to quit the search buffer and
return to the hello buffer, would result in all evil state keybindings
in `notmuch-hello-mode-map` being deactivated. Rewriting the
`evil-collection-notmuch-hello-ret` function resolves this issue.
  • Loading branch information
milanglacier authored and condy0919 committed Aug 5, 2024
1 parent 28d6403 commit 7ec3ba5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modes/notmuch/evil-collection-notmuch.el
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
(declare-function notmuch-search-tag "notmuch")
(declare-function notmuch-tree-tag "notmuch-tree")

(declare-function widget-field-at "wid-edit")
(declare-function widget-field-activate "wid-edit")
(declare-function widget-button-press "wid-edit")

;; 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
Expand Down Expand Up @@ -103,8 +107,9 @@

(defun evil-collection-notmuch-hello-ret ()
(interactive)
(evil-execute-in-emacs-state)
(call-interactively (key-binding (kbd "RET"))))
(if (widget-field-at (point))
(call-interactively #'widget-field-activate)
(call-interactively #'widget-button-press)))

;;;###autoload
(defun evil-collection-notmuch-setup ()
Expand Down

0 comments on commit 7ec3ba5

Please sign in to comment.