From 10f8d7dfd552c2bfc0e237d6a5d7d8d1c5265881 Mon Sep 17 00:00:00 2001
From: jao <jao@gnu.org>
Date: Wed, 25 Nov 2020 05:04:10 +0000
Subject: jao-maildir: accepting regexps for tracked dirs

---
 net/jao-maildir.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/jao-maildir.el b/net/jao-maildir.el
index cae0372..701a848 100644
--- a/net/jao-maildir.el
+++ b/net/jao-maildir.el
@@ -27,12 +27,14 @@
 
 ;;; Code:
 
+(require 'seq)
 (require 'jao-minibuffer)
 
 (defvar jao-maildirs nil)
 (defvar jao-maildir-counts nil)
 (defvar jao-maildir-debug-p nil)
 (defvar jao-maildir-echo-p t)
+(defvar jao-maildir-tracked-maildirs nil)
 
 (defun jao-maildir--maildir-new (mbox) (expand-file-name "new" mbox))
 
@@ -56,6 +58,10 @@
   "Face used to highlihgt non-boring tracked maildirs"
   :group 'jao-maildir-faces)
 
+(defun jao-maildir--tracked (m)
+  (seq-find (lambda (e) (string-match-p (car e) m))
+            jao-maildir-tracked-maildirs))
+
 (defun jao-maildir--update-info-string ()
   (let ((total 0)
         (counts))
@@ -63,11 +69,12 @@
       (when (> (cdr c) 0)
         (let* ((m (car c))
                (n (cdr c))
-               (a (assoc m jao-maildir-tracked-maildirs))
+               (a (jao-maildir--tracked m))
                (an (cadr a))
                (ab (caddr a))
                (am (when a (format "%s%s" an n)))
-               (am (when am (if ab am (propertize am 'face 'jao-maildir-emph)))))
+               (f (when am (if (eq t ab) 'jao-maildir-emph ab)))
+               (am (when am (if f (propertize am 'face f) am))))
           (when (null a) (setq total (+ n total)))
           (when a
             (if ab (push am counts) (setq counts (nconc counts (list am))))))))
-- 
cgit v1.2.3