diff options
| author | Milan Glacier <dev@milanglacier.com> | 2024-07-08 14:50:13 -0400 |
|---|---|---|
| committer | Youmu <condy0919@gmail.com> | 2024-08-05 23:46:56 +0800 |
| commit | 7ec3ba5e1ffe786feef18aef4cf7f9b0843acd44 (patch) | |
| tree | 67e503d8549c41cfb7320308542b055dbfc67555 | |
| parent | 28d64031ff58871828a0dec25ef437beb9371337 (diff) | |
notmuch: fix `RET` keybinding in `notmuch-hello-mode`.
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.
| -rw-r--r-- | modes/notmuch/evil-collection-notmuch.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modes/notmuch/evil-collection-notmuch.el b/modes/notmuch/evil-collection-notmuch.el index 558829a..41c97fe 100644 --- a/modes/notmuch/evil-collection-notmuch.el +++ b/modes/notmuch/evil-collection-notmuch.el @@ -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 @@ -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 () |
