diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-21 19:59:50 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-22 10:46:42 -0200 |
commit | 316829ed9414e96684ba2dd82100426d28d7215f (patch) | |
tree | 700c6c981d39b7c12805927e21f1c3ac813a13a9 /sx-notify.el | |
parent | b854489549490a53713f0777ac4c22096920e19f (diff) |
Move unread lists to sx-inbox
Diffstat (limited to 'sx-notify.el')
-rw-r--r-- | sx-notify.el | 36 |
1 files changed, 11 insertions, 25 deletions
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) |