From 21004e70921566b7a616ecd657e3afc07d501599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Sat, 6 May 2023 09:46:27 -0700 Subject: emacs: notmuch indicator, sections and binds --- .emacs.local.d/modes/notmuch.el | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to '.emacs.local.d/modes') diff --git a/.emacs.local.d/modes/notmuch.el b/.emacs.local.d/modes/notmuch.el index c84f5a6..54178e6 100644 --- a/.emacs.local.d/modes/notmuch.el +++ b/.emacs.local.d/modes/notmuch.el @@ -2,6 +2,7 @@ ;; notmuch mode ;; -------- (require 'notmuch) +(require 'notmuch-indicator) (require 'rul-config-mail) ;; Keymaps @@ -98,3 +99,27 @@ than one email. Use notmuch-show otherwise." (add-hook 'notmuch-hello-refresh-hook 'color-inbox-if-unread) (add-hook 'notmuch-hello-refresh-hook 'notmuch-hello-refresh-status-message) + +(setq notmuch-hello-sections '(notmuch-hello-insert-saved-searches + notmuch-hello-insert-search + notmuch-hello-insert-recent-searches + notmuch-hello-insert-alltags + )) + +;; https://git.sr.ht/~tslil/dotfiles/tree/4e51afbb/emacs/notmuch-config.el#L76-82 +(defmacro make-binds (mode-map binds argfunc &rest body) + "Create keybindings in `mode-map' using a list of (keystr . arg) +pairs in `binds' of the form ( ... (argfunc arg) body)." + `(progn ,@(mapcar (lambda (pair) + `(define-key ,mode-map (kbd ,(car pair)) + (lambda () (interactive) (,argfunc ,(cdr pair)) ,@body))) + (eval binds)))) + +(defvar notmuch-hello-tree-searches '(("u" . "tag:unread") + ("i" . "tag:inbox") + ("*" . "*")) + "List of (key . query) pairs to bind in notmuch-hello.") + +(make-binds notmuch-hello-mode-map + notmuch-hello-tree-searches + notmuch-search) -- cgit v1.2.3