diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-29 17:41:05 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-29 17:41:22 +0000 |
commit | 9a39c5d985423e3675cfcd56cf951bb3ab283147 (patch) | |
tree | 7149540f6c86259efd7883ec13505908100c7aa3 | |
parent | 9d39b0d1bcaa3186e21171f656b807fde2611b53 (diff) |
Normalize and improve button help-echo's
-rw-r--r-- | sx-button.el | 21 | ||||
-rw-r--r-- | sx-question-print.el | 6 |
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'." |