From 78e066b94809fb7746086a1ca6b7d7c39d353343 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 14 Mar 2024 08:12:18 +0200 Subject: Add gnosis-modeline-mode Minor mode to display total due notes on modeline. --- gnosis.el | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/gnosis.el b/gnosis.el index b8d3467..c52ada3 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1745,9 +1745,27 @@ DASHBOARD-TYPE: either 'Notes' or 'Decks' to display the respective dashboard." ;; Gnosis mode ;; ;;;;;;;;;;;;;;;;; +;;;###autoload +(define-minor-mode gnosis-modeline-mode + "Minor mode for showing gnosis total due notes on modeline." + :global t + :group 'gnosis + :lighter nil + (if gnosis-modeline-mode + (progn + (add-to-list 'global-mode-string '(:eval + (format " G:%d" (length (gnosis-review-get-due-notes))))) + (force-mode-line-update)) + (setq global-mode-string + (seq-remove (lambda (item) + (and (listp item) (eq (car item) :eval) + (string-prefix-p " G:" (format "%s" (eval (cadr item)))))) + global-mode-string)) + (force-mode-line-update))) + (define-derived-mode gnosis-mode special-mode "Gnosis" "Gnosis Mode." - :interactive t + :interactive nil (read-only-mode 0) (display-line-numbers-mode 0) :lighter " gnosis-mode") -- cgit v1.2.3