aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-button.el8
-rw-r--r--sx-question-print.el3
2 files changed, 11 insertions, 0 deletions
diff --git a/sx-button.el b/sx-button.el
index c1abf90..cd01598 100644
--- a/sx-button.el
+++ b/sx-button.el
@@ -121,6 +121,14 @@ code-block."
'action #'sx-comment
:supertype 'sx-button)
+(define-button-type 'sx-button-answer
+ 'help-echo (concat "mouse-1, RET"
+ (propertize ": write an answer"
+ 'face 'minibuffer-prompt))
+ 'face 'custom-button
+ 'action #'sx-answer
+ :supertype 'sx-button)
+
(provide 'sx-button)
;;; sx-button.el ends here
diff --git a/sx-question-print.el b/sx-question-print.el
index 307742a..f206f56 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -177,6 +177,9 @@ QUESTION must be a data structure returned by `json-read'."
(sx-question-mode--print-section question)
(sx-assoc-let question
(mapc #'sx-question-mode--print-section .answers))
+ (insert "\n\n ")
+ (insert-text-button "Write an Answer" :type 'sx-button-answer)
+ ;; Reposition
(goto-char (point-min))
(sx-question-mode-next-section))