aboutsummaryrefslogtreecommitdiff
path: root/sx-question-print.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-27 17:59:54 -0300
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-27 18:52:17 -0300
commite63a29e71d645e67275cb962ec0839e61da90863 (patch)
tree7def83a50620ae933c603500ebc6c34bb8092e73 /sx-question-print.el
parent382fd490f71e00cc293e2ab98cfb7b7b1c59c201 (diff)
Add mode-line info for closed questions.
Diffstat (limited to 'sx-question-print.el')
-rw-r--r--sx-question-print.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/sx-question-print.el b/sx-question-print.el
index 32a0813..9e726b4 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -201,6 +201,10 @@ type is not available, images won't work."
;;; Functions
;;;; Printing the general structure
+(defconst sx-question-mode--closed-mode-line-string
+ '(:propertize " [CLOSED] " face font-lock-warning-face)
+ "String indicating closed questions in the mode-line.")
+
(defun sx-question-mode--print-question (question)
"Print a buffer describing QUESTION.
QUESTION must be a data structure returned by `json-read'."
@@ -213,6 +217,7 @@ QUESTION must be a data structure returned by `json-read'."
;; Print everything
(sx-assoc-let question
(when .closed_reason
+ (add-to-list 'mode-line-format sx-question-mode--closed-mode-line-string)
(sx-question-mode--print-close-reason .closed_reason .closed_date))
(sx-question-mode--print-section question)
(mapc #'sx-question-mode--print-section