aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-question-list.el10
-rw-r--r--sx-question.el8
2 files changed, 8 insertions, 10 deletions
diff --git a/sx-question-list.el b/sx-question-list.el
index c6eb58e..82f0017 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -51,11 +51,7 @@
:group 'sx-question-list-faces)
(defface sx-question-list-answers-accepted
- '((((background light)) :background "YellowGreen"
- :inherit sx-question-list-answers)
- (((background dark)) :background "DarkOliveGreen"
- :inherit sx-question-list-answers)
- (t :inherit sx-question-list-answers))
+ '((t :underline t :overline t :inherit sx-question-list-answers))
""
:group 'sx-question-list-faces)
@@ -228,13 +224,13 @@ Used in the questions list to indicate a question was updated \"4d ago\"."
'face (if .upvoted 'sx-question-list-score-upvoted
'sx-question-list-score))
(list (int-to-string .answer_count)
- 'face (if (sx-question--accepted-answer .data)
+ 'face (if (sx-question--accepted-answer data)
'sx-question-list-answers-accepted
'sx-question-list-answers))
(concat
(propertize
.title
- 'face (if (sx-question--read-p .data)
+ 'face (if (sx-question--read-p data)
'sx-question-list-read-question
;; Increment `sx-question-list--unread-count' for the mode-line.
(cl-incf sx-question-list--unread-count)
diff --git a/sx-question.el b/sx-question.el
index d15cc80..19251ab 100644
--- a/sx-question.el
+++ b/sx-question.el
@@ -34,6 +34,7 @@
question.comments
question.answers
question.last_editor
+ question.accepted_answer_id
user.display_name
comment.owner
comment.body_markdown
@@ -69,10 +70,11 @@
;; @TODO:
(cl-evenp (random)))
-(defun sx-question--accepted-answer (question)
+(defun sx-question--accepted-answer-id (question)
"Return accepted answer in QUESTION, or nil if none."
- ;; @TODO:
- (cl-evenp (random)))
+ (sx-assoc-let question
+ (and (integerp .accepted_answer_id)
+ .accepted_answer_id)))
(defun sx-question--mark-read (question)
"Mark QUESTION as being read, until it is updated again."