aboutsummaryrefslogtreecommitdiff
path: root/.emacs.local.d
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.local.d')
-rw-r--r--.emacs.local.d/modes/notmuch.el25
1 files changed, 25 insertions, 0 deletions
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)
nihil fit ex nihilo