aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2018-02-12 13:01:14 -0600
committerGitHub <noreply@github.com>2018-02-12 13:01:14 -0600
commit833435fbf90d1c9e927d165b155f3b1ef39271de (patch)
treee7274bde0b5e79b12593c8e36852f2e86a4963de
parent95100fa3c933f6b00519baa3c7073b882a1b4603 (diff)
parentf1b88ead334bb7b98269ef8f4c8ff31abc94eb69 (diff)
Merge pull request #344 from Boruch-Baum/master
propertize unread inbox items
-rw-r--r--sx-inbox.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/sx-inbox.el b/sx-inbox.el
index 1f0f227..593128a 100644
--- a/sx-inbox.el
+++ b/sx-inbox.el
@@ -56,6 +56,12 @@
:type 'integer
:group 'sx)
+(defface sx-inbox-item-type
+ '((t :inherit font-lock-keyword-face)) "")
+
+(defface sx-inbox-item-type-unread
+ '((t :inherit font-lock-keyword-face :weight bold)) "")
+
(defun sx-inbox-get (&optional notifications page keywords)
"Get an array of inbox items for the current user.
If NOTIFICATIONS is non-nil, query from `notifications' method,
@@ -161,23 +167,22 @@ is an alist containing the elements:
(cond (.answer_id " on Answer at:")
(.question_id " on:")
(t ":")))
- 'face 'font-lock-keyword-face)
+ 'face (if .is_unread 'sx-inbox-item-type-unread 'sx-inbox-item-type))
(list
(concat (sx-time-since .creation_date)
sx-question-list-ago-string)
'face 'sx-question-list-date)
(list
- (propertize
- " " 'display
- (concat "\n " (propertize (or .title "") 'face 'sx-question-list-date) "\n"
+ (propertize " " 'display
+ (concat " " (propertize (or .title "") 'face 'sx-question-list-date) "\n"
(when .body
(let ((col fill-column))
(with-temp-buffer
(setq fill-column col)
- (insert " " .body)
+ (insert " " .body)
(fill-region (point-min) (point-max))
(buffer-string))))
- 'face 'default)))))))
+ "\n" ) 'face (if .is_unread 'bold 'default) ))))))
;;; Entry commands