aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-button.el21
-rw-r--r--sx-question-print.el6
2 files changed, 20 insertions, 7 deletions
diff --git a/sx-button.el b/sx-button.el
index aa77086..ed94558 100644
--- a/sx-button.el
+++ b/sx-button.el
@@ -56,6 +56,25 @@ This is usually a link's URL, or the content of a code block."
(or (get-text-property (or pos (point)) 'sx-button-url)
(user-error "No url under point: %s" (or pos (point))))))
+(defvar sx-button--help-echo
+ (concat "mouse-1, RET"
+ (propertize ": %s -- " 'face 'minibuffer-prompt)
+ "w"
+ (propertize ": copy %s" 'face 'minibuffer-prompt))
+ "Base help-echo on which others can be written.")
+
+(defvar sx-button--question-title-help-echo
+ (format sx-button--help-echo
+ (propertize "hide content" 'face 'minibuffer-prompt)
+ (propertize "link" 'face 'minibuffer-prompt))
+ "Help echoed in the minibuffer when point is on a section.")
+
+(defvar sx-button--link-help-echo
+ (format sx-button--help-echo
+ (propertize "visit %s" 'face 'minibuffer-prompt)
+ (propertize "URL" 'face 'minibuffer-prompt))
+ "Help echoed in the minibuffer when point is on a section.")
+
;;; Type definitions
(define-button-type 'sx-button
@@ -65,7 +84,7 @@ This is usually a link's URL, or the content of a code block."
(define-button-type 'sx-question-mode-title
'face 'sx-question-mode-title
'action #'sx-question-mode-hide-show-section
- 'help-echo 'sx-question-mode--section-help-echo
+ 'help-echo sx-button--question-title-help-echo
'sx-button-copy-type "Share Link"
:supertype 'sx-button)
diff --git a/sx-question-print.el b/sx-question-print.el
index 5b6c5be..e8efa2d 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -166,12 +166,6 @@ replaced with the comment."
;;; Functions
;;;; Printing the general structure
-(defvar sx-question-mode--section-help-echo
- (format
- (propertize "%s to hide/display content" 'face 'minibuffer-prompt)
- (propertize "RET" 'face 'font-lock-function-name-face))
- "Help echoed in the minibuffer when point is on a section.")
-
(defun sx-question-mode--print-question (question)
"Print a buffer describing QUESTION.
QUESTION must be a data structure returned by `json-read'."