feat(mail): remove keybindings tree

This commit is contained in:
Pavel Korytov 2023-07-29 00:37:51 +03:00
parent ab0d01c525
commit 05c581a633
2 changed files with 4 additions and 54 deletions

View file

@ -45,9 +45,7 @@
(lambda () (display-line-numbers-mode 0))))
(my-leader-def
:infix "am"
"" '(:which-key "notmuch")
"m" (my/command-in-persp "notmuch" "mail" 0 (notmuch)))
"am" (my/command-in-persp "notmuch" "mail" 0 (notmuch)))
(my/persp-add-rule
notmuch-hello-mode 0 "mail"
@ -70,24 +68,6 @@
(:name "pvkorytov (sent)" :query "tag:pvkorytov AND tag:sent")
(:name "pvkorytov (all mail)" :query "tag:pvkorytov")))
(my-leader-def
:infix "am"
"t" '(:which-key "thexcloud@gmail.com")
"ti" (my/command-in-persp "tag:main AND tag:inbox" "mail" 0 (notmuch-search "inbox"))
"tu" (my/command-in-persp "tag:main AND tag:unread" "mail" 0 (notmuch-search "unread"))
"ts" (my/command-in-persp "tag:main AND tag:sent" "mail" 0 (notmuch-search "sent"))
"ta" (my/command-in-persp "tag:main" "mail" 0 (notmuch-search "all mail"))
"p" '(:which-key "progin6304@gmail.com")
"pi" (my/command-in-persp "tag:progin AND tag:inbox" "mail" 0 (notmuch-search "inbox"))
"pu" (my/command-in-persp "tag:progin AND tag:unread" "mail" 0 (notmuch-search "unread"))
"ps" (my/command-in-persp "tag:progin AND tag:sent" "mail" 0 (notmuch-search "sent"))
"pa" (my/command-in-persp "tag:progin" "mail" 0 (notmuch-search "all mail"))
"e" '(:which-key "pvkorytov@etu.ru")
"ei" (my/command-in-persp "tag:pvkorytov AND tag:inbox" "mail" 0 (notmuch-search "inbox"))
"eu" (my/command-in-persp "tag:pvkorytov AND tag:unread" "mail" 0 (notmuch-search "unread"))
"es" (my/command-in-persp "tag:pvkorytov AND tag:sent" "mail" 0 (notmuch-search "sent"))
"ea" (my/command-in-persp "tag:pvkorytov" "mail" 0 (notmuch-search "all mail")))
(with-eval-after-load 'notmuch
(add-hook 'message-setup-hook 'mml-secure-sign-pgpmime))

View file

@ -430,15 +430,13 @@ And notmuch settings:
The file is read in =init.el=.
** Saved filters and keybindings
I want to have the saved filters available in both notmuch interface as as keybindings. So a bit more of abusing org tables.
** Keybindings
I used to have a more complicated keybinding system here, but that seemed to go against the Dao.
Root keybindings:
#+begin_src emacs-lisp
(my-leader-def
:infix "am"
"" '(:which-key "notmuch")
"m" (my/command-in-persp "notmuch" "mail" 0 (notmuch)))
"am" (my/command-in-persp "notmuch" "mail" 0 (notmuch)))
#+end_src
#+begin_src emacs-lisp
@ -483,38 +481,10 @@ The following formats the tables above to a proper syntax for =setq notmuch-save
(string-join searches "\n"))
#+end_src
And the following does the same for my general.el definer:
#+NAME: format-notmuch-keybindings
#+begin_src emacs-lisp :var root_tags=root_tags filter_tags=filter_tags :tangle no
(let ((bindings '()))
(dolist (root_tag root_tags)
(add-to-list
'bindings
(format "\"%s\" '(:which-key \"%s\")"
(nth 1 root_tag)
(nth 2 root_tag))
t)
(dolist (tag filter_tags)
(add-to-list
'bindings
(format "\"%s\" (my/command-in-persp \"%s\" \"mail\" 0 (notmuch-search \"%s\"))"
(concat (nth 1 root_tag) (nth 1 tag))
(concat "tag:" (nth 0 root_tag)
(unless (string-empty-p (nth 0 tag))
(concat " AND tag:" (nth 0 tag))))
(nth 2 tag))
t)))
(string-join bindings "\n"))
#+end_src
#+begin_src emacs-lisp :noweb yes
(setq notmuch-saved-searches
'((:name "drafts" :query "tag:draft")
<<format-notmuch-saved-searches()>>))
(my-leader-def
:infix "am"
<<format-notmuch-keybindings()>>)
#+end_src
** Signing messages
#+begin_src emacs-lisp