From 1372099300f33471bdf30a21bf479592450745ef Mon Sep 17 00:00:00 2001 From: Boruch Baum Date: Sun, 11 Feb 2018 15:43:14 -0500 Subject: propertize unread inbox items * Create new customizable faces `sx-inbox-item-type' and `sx-inbox-item-type-unread' to replace use of `font-lock-keyword-fase'. * Separate inbox items with a newline. --- sx-inbox.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sx-inbox.el b/sx-inbox.el index 1f0f227..7df0862 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,7 +167,7 @@ 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) @@ -176,8 +182,8 @@ is an alist containing the elements: (setq fill-column col) (insert " " .body) (fill-region (point-min) (point-max)) - (buffer-string)))) - 'face 'default))))))) + (buffer-string))) "\n") + 'face (if .is_unread 'bold 'default)))))))) ;;; Entry commands -- cgit v1.2.3