diff options
author | Boruch Baum <boruch_baum@gmx.com> | 2018-02-11 15:43:14 -0500 |
---|---|---|
committer | Boruch Baum <boruch_baum@gmx.com> | 2018-02-11 15:43:14 -0500 |
commit | 1372099300f33471bdf30a21bf479592450745ef (patch) | |
tree | ea1eb6cdf1a92eaf5595ef1cbcafa7056daf1f2f | |
parent | 95100fa3c933f6b00519baa3c7073b882a1b4603 (diff) |
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.
-rw-r--r-- | sx-inbox.el | 12 |
1 files 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 |