summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-04-02 23:04:49 +0100
committerjao <jao@gnu.org>2024-04-02 23:06:43 +0100
commit5660eb048b483889d10c28ff70dcdac3027a0cc4 (patch)
tree511eae4ccaf591e80bfc7c2c601265ff3b407f15
parentd431600144b54eac44a3f43289b64cf573ae0561 (diff)
downloadelibs-5660eb048b483889d10c28ff70dcdac3027a0cc4.tar.gz
elibs-5660eb048b483889d10c28ff70dcdac3027a0cc4.tar.bz2
notmuch: tree message counts in modeline rather than header
-rw-r--r--custom/jao-custom-notmuch.el2
-rw-r--r--lib/net/jao-notmuch.el13
-rw-r--r--lib/themes/jao-light-theme.el1
3 files changed, 14 insertions, 2 deletions
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el
index 524a767..0cbbfaa 100644
--- a/custom/jao-custom-notmuch.el
+++ b/custom/jao-custom-notmuch.el
@@ -372,7 +372,7 @@
:init
(setq gnus-blocked-images "."
notmuch-message-headers
- '("To" "Cc" "Date" "Reply-To" "List-Id" "X-RSS-Feed")
+ '("Subject" "To" "Cc" "Date" "Reply-To" "List-Id" "X-RSS-Feed")
notmuch-show-only-matching-messages t
notmuch-show-part-button-default-action 'notmuch-show-view-part
notmuch-wash-signature-lines-max 0
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index 92ed49f..aef9757 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -1,6 +1,6 @@
;;; jao-notmuch.el --- Extensions for notmuch -*- lexical-binding: t; -*-
-;; Copyright (C) 2021, 2022, 2023 jao
+;; Copyright (C) 2021, 2022, 2023, 2024 jao
;; Author: jao <mail@jao.io>
;; Keywords: mail
@@ -269,6 +269,17 @@
`((:eval (jao-notmuch--format-header-line ,(buffer-name tb) ,cb ,subject)))
(concat " " subject)))
+(defun jao-notmuch--format-lighter ()
+ (when (derived-mode-p 'notmuch-tree-mode)
+ (let* ((n (jao-notmuch--message-counts (current-buffer)))
+ (nc (jao-notmuch--message-counts (current-buffer) t))
+ (nc (append (or n '(0 0 0)) (or nc '(0 0 0)))))
+ (apply 'jao-notmuch--format-counts "" nc))))
+
+(define-minor-mode jao-notmuch-thread-info-mode ""
+ :lighter (:eval (format " %s" (jao-notmuch--format-lighter))))
+
+
;;; tagging
(defsubst jao-notmuch--has-tag (tag)
diff --git a/lib/themes/jao-light-theme.el b/lib/themes/jao-light-theme.el
index d4f3f6a..a172f84 100644
--- a/lib/themes/jao-light-theme.el
+++ b/lib/themes/jao-light-theme.el
@@ -100,6 +100,7 @@
:box (:line-width 1 :color "grey90"))
(magit-diff-context-highlight (c nil yellow) ex)
(magit-diff-hunk-heading-highlight (c nil hl) it bf)
+ (message-header-subject (p warning) nbf)
(mode-line (c "grey20") :box (:line-width 1 :color "grey80"))
(mode-line-inactive
(c "grey40" bg-light) :box (:line-width 1 :color "grey80"))