aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-inbox.el15
-rw-r--r--sx-notify.el36
2 files changed, 26 insertions, 25 deletions
diff --git a/sx-inbox.el b/sx-inbox.el
index 3bc95c8..9cdb959 100644
--- a/sx-inbox.el
+++ b/sx-inbox.el
@@ -63,6 +63,21 @@ KEYWORDS are added to the method call along with PAGE.
:keywords keywords
:filter sx-inbox-filter))
+
+;;; Major-mode
+(defvar sx-inbox--unread-inbox nil
+ "List of inbox items still unread.")
+
+(defvar sx-inbox--unread-notifications nil
+ "List of notifications items still unread.")
+
+(defvar sx-inbox--read-inbox nil
+ "List of inbox items which are read.
+These are identified by their links.")
+
+(defvar sx-inbox--read-notifications nil
+ "List of notification items which are read.
+These are identified by their links.")
(provide 'sx-inbox)
;;; sx-inbox.el ends here
diff --git a/sx-notify.el b/sx-notify.el
index 05babad..c335427 100644
--- a/sx-notify.el
+++ b/sx-notify.el
@@ -27,33 +27,19 @@
;;; mode-line notification
-(defvar sx-notify--unread-inbox nil
- "List of inbox items still unread.")
-
-(defvar sx-notify--unread-notifications nil
- "List of notifications items still unread.")
-
-(defvar sx-notify--read-inbox nil
- "List of inbox items which are read.
-These are identified by their links.")
-
-(defvar sx-notify--read-notifications nil
- "List of notification items which are read.
-These are identified by their links.")
-
(defvar sx-notify--mode-line
- '((sx-notify--unread-inbox (sx-notify--unread-notifications " ["))
- (sx-notify--unread-inbox
+ '((sx-inbox--unread-inbox (sx-inbox--unread-notifications " ["))
+ (sx-inbox--unread-inbox
(:propertize
- (:eval (format "i:%s" (length sx-notify--unread-inbox)))
+ (:eval (format "i:%s" (length sx-inbox--unread-inbox)))
face mode-line-buffer-id
mouse-face mode-line-highlight))
- (sx-notify--unread-inbox (sx-notify--unread-notifications " "))
- (sx-notify--unread-notifications
+ (sx-inbox--unread-inbox (sx-inbox--unread-notifications " "))
+ (sx-inbox--unread-notifications
(:propertize
- (:eval (format "n:%s" (length sx-notify--unread-notifications)))
+ (:eval (format "n:%s" (length sx-inbox--unread-notifications)))
mouse-face mode-line-highlight))
- (sx-notify--unread-inbox (sx-notify--unread-notifications "]")))
+ (sx-inbox--unread-inbox (sx-notify--unread-notifications "]")))
"")
(put 'sx-notify--mode-line 'risky-local-variable t)
@@ -83,13 +69,13 @@ These are identified by their links.")
(defun sx-notify--update-unread ()
"Update the lists of unread notifications."
- (setq sx-notify--unread-inbox
+ (setq sx-inbox--unread-inbox
(cl-remove-if
- (lambda (x) (member (cdr (assq 'link x)) sx-notify--read-inbox))
+ (lambda (x) (member (cdr (assq 'link x)) sx-inbox--read-inbox))
(append (sx-inbox-get) nil)))
- (setq sx-notify--unread-notifications
+ (setq sx-inbox--unread-notifications
(cl-remove-if
- (lambda (x) (member (cdr (assq 'link x)) sx-notify--read-notifications))
+ (lambda (x) (member (cdr (assq 'link x)) sx-inbox--read-notifications))
(append (sx-inbox-get t) nil))))
(provide 'sx-notify)