emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/nano-modeline 074c3dc 03/25: Update elfeed mode


From: ELPA Syncer
Subject: [elpa] externals/nano-modeline 074c3dc 03/25: Update elfeed mode
Date: Thu, 23 Dec 2021 12:57:28 -0500 (EST)

branch: externals/nano-modeline
commit 074c3dcc6f9626de31092b17d19c37cce25bb367
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>

    Update elfeed mode
---
 nano-modeline.el | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/nano-modeline.el b/nano-modeline.el
index 86d3df3..d37cab1 100644
--- a/nano-modeline.el
+++ b/nano-modeline.el
@@ -270,10 +270,30 @@ Modeline is composed as:
   (derived-mode-p 'elfeed-search-mode))
 
 (defun nano-modeline-elfeed-search-mode ()
-  (nano-modeline-compose (nano-modeline-status)
-                         "Elfeed"
-                         (concat "(" (elfeed-search--header)  ")")
-                         ""))
+  (let* ((prefix "NEWS")
+        (no-database (zerop (elfeed-db-last-update)))
+        (update      (> (elfeed-queue-count-total) 0))
+        
+        (name  (cond (no-database "No database")
+                     (update      "Update:") 
+                     (t           "Search:")))
+        (primary (cond  (no-database "")
+                        (update
+                         (let ((total (elfeed-queue-count-total))
+                               (in-process (elfeed-queue-count-active)))
+                           (format "%d jobs pending, %d active..."
+                                   (- total in-process) in-process)))
+                        (t  (let* ((db-time (seconds-to-time 
(elfeed-db-last-update)))
+                                   (unread ))
+                              (cond (elfeed-search-filter-active "")
+                                    ((string-match-p "[^ ]" 
elfeed-search-filter)
+                                     elfeed-search-filter)
+                                    (""))))))
+        (secondary (cond
+                    ((zerop (elfeed-db-last-update)) "")
+                    ((> (elfeed-queue-count-total) 0) "")
+                    (t (elfeed-search--count-unread)))))
+    (nano-modeline-render prefix name primary secondary)))
 
 (defun nano-modeline-elfeed-setup-header ()
   (setq header-line-format (default-value 'header-line-format)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]