summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-03-14 08:12:18 +0200
committerThanos Apollo <[email protected]>2024-03-14 08:12:18 +0200
commit78e066b94809fb7746086a1ca6b7d7c39d353343 (patch)
treef28fed86811f690727dd6d8709a726edefee0d69 /gnosis.el
parentfa24681514ea446f63e0c1fef5ebc67b31570ff6 (diff)
Add gnosis-modeline-mode
Minor mode to display total due notes on modeline.
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el20
1 files changed, 19 insertions, 1 deletions
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")