aboutsummaryrefslogtreecommitdiff
path: root/sx-question-list.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2015-01-04 15:33:11 -0500
committerSean Allred <code@seanallred.com>2015-01-04 15:33:11 -0500
commitbc86289de1cccaca199639911439ec9a600f8f34 (patch)
tree5100c4469864c34f7e52c22bf8283bd36c38867a /sx-question-list.el
parent87d010c9974963a1f92f7136bec9df084e050e90 (diff)
parentdf4a8bba9b720357008423b8f91657a8a311607a (diff)
Merge pull request #195 from vermiculus/issue-15-more-info
Issue 15 more info
Diffstat (limited to 'sx-question-list.el')
-rw-r--r--sx-question-list.el38
1 files changed, 34 insertions, 4 deletions
diff --git a/sx-question-list.el b/sx-question-list.el
index 0a8e72c..40b72b9 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -104,6 +104,21 @@
""
:group 'sx-question-list-faces)
+(defface sx-question-list-bounty
+ '((t :inherit font-lock-warning-face))
+ ""
+ :group 'sx-question-list-faces)
+
+(defface sx-question-list-reputation
+ '((t :inherit sx-question-list-date))
+ ""
+ :group 'sx-question-list-faces)
+
+(defface sx-question-list-user
+ '((t :inherit font-lock-builtin-face))
+ ""
+ :group 'sx-question-list-faces)
+
;;; Backend variables
(defvar sx-question-list--print-function #'sx-question-list--print-info
@@ -141,20 +156,35 @@ Also see `sx-question-list-refresh'."
'sx-question-list-answers-accepted
'sx-question-list-answers))
(concat
+ ;; First line
(propertize
.title
'face (if (sx-question--read-p question-data)
'sx-question-list-read-question
'sx-question-list-unread-question))
(propertize " " 'display "\n ")
+ ;; Second line
(propertize favorite 'face 'sx-question-list-favorite)
- " "
- (propertize (concat (sx-time-since .last_activity_date)
- sx-question-list-ago-string)
+ (if (and (numberp .bounty_amount) (> .bounty_amount 0))
+ (propertize (format "%4d" .bounty_amount)
+ 'face 'sx-question-list-bounty)
+ " ")
+ " "
+ (propertize (format "%3s%s"
+ (sx-time-since .last_activity_date)
+ sx-question-list-ago-string)
'face 'sx-question-list-date)
" "
- (propertize (mapconcat #'sx-question--tag-format .tags " ")
+ ;; @TODO: Make this width customizable. (Or maybe just make
+ ;; the whole thing customizable)
+ (propertize (format "%-40s" (mapconcat #'sx-question--tag-format .tags " "))
'face 'sx-question-list-tags)
+ " "
+ (let-alist .owner
+ (format "%15s %5s"
+ (propertize .display_name 'face 'sx-question-list-user)
+ (propertize (number-to-string .reputation)
+ 'face 'sx-question-list-reputation)))
(propertize " " 'display "\n")))))))
(defvar sx-question-list--pages-so-far 0