diff options
author | Boruch Baum <boruch_baum@gmx.com> | 2018-02-11 22:07:50 -0500 |
---|---|---|
committer | Boruch Baum <boruch_baum@gmx.com> | 2018-02-11 22:07:50 -0500 |
commit | 634320e6e989df30bf17c9a483f7105b76b1314e (patch) | |
tree | e7274bde0b5e79b12593c8e36852f2e86a4963de | |
parent | 95100fa3c933f6b00519baa3c7073b882a1b4603 (diff) |
bugfix: propertize unread inbox items
* correction for occurence of "propertize: Wrong type argument:
sequencep, face".
* adjust indent and vertical spacing for readability.
-rw-r--r-- | sx-inbox.el | 17 |
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 |