diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-15 01:52:27 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-15 01:52:27 +0000 |
commit | 6a2252c6e6aec21cb9c9336b706947343f9e4fa6 (patch) | |
tree | 413fbbfd9cbb604230b75ba853b220ce028759f7 | |
parent | 05deb5d7d095e0e8708733f508a42db7985c1e43 (diff) |
Highlighting accepted answers actually works now.
-rw-r--r-- | sx-question-list.el | 10 | ||||
-rw-r--r-- | sx-question.el | 8 |
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." |