From 5660eb048b483889d10c28ff70dcdac3027a0cc4 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 2 Apr 2024 23:04:49 +0100 Subject: notmuch: tree message counts in modeline rather than header --- lib/net/jao-notmuch.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/net/jao-notmuch.el') 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 ;; 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) -- cgit v1.2.3