ui/doom-dashboard: show command at point in echo-area
This commit is contained in:
parent
21e01189b9
commit
735ec58b36
2 changed files with 17 additions and 9 deletions
|
@ -1,5 +1,10 @@
|
||||||
;;; ui/doom-dashboard/autoload.el -*- lexical-binding: t; -*-
|
;;; ui/doom-dashboard/autoload.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defun +doom-dashboard--help-echo ()
|
||||||
|
(when-let* ((btn (button-at (point)))
|
||||||
|
(msg (button-get btn 'help-echo)))
|
||||||
|
(message "%s" msg)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +doom-dashboard/open (frame)
|
(defun +doom-dashboard/open (frame)
|
||||||
"Switch to the dashboard in the current window, of the current FRAME."
|
"Switch to the dashboard in the current window, of the current FRAME."
|
||||||
|
@ -12,10 +17,12 @@
|
||||||
(defun +doom-dashboard/forward-button (n)
|
(defun +doom-dashboard/forward-button (n)
|
||||||
"Like `forward-button', but don't wrap."
|
"Like `forward-button', but don't wrap."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
(forward-button n nil))
|
(forward-button n nil)
|
||||||
|
(+doom-dashboard--help-echo))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +doom-dashboard/backward-button (n)
|
(defun +doom-dashboard/backward-button (n)
|
||||||
"Like `backward-button', but don't wrap."
|
"Like `backward-button', but don't wrap."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
(backward-button n nil))
|
(backward-button n nil)
|
||||||
|
(+doom-dashboard--help-echo))
|
||||||
|
|
|
@ -416,16 +416,17 @@ controlled by `+doom-dashboard-pwd-policy'."
|
||||||
#',action)))
|
#',action)))
|
||||||
'face (or face 'font-lock-keyword-face)
|
'face (or face 'font-lock-keyword-face)
|
||||||
'follow-link t
|
'follow-link t
|
||||||
'help-echo label)
|
'help-echo
|
||||||
|
(format "%s (%s)" label
|
||||||
|
(propertize (symbol-name action) 'face 'font-lock-constant-face)))
|
||||||
(format "%-37s" (buffer-string)))
|
(format "%-37s" (buffer-string)))
|
||||||
;; Lookup command keys dynamically
|
;; Lookup command keys dynamically
|
||||||
(or (when-let* ((key (where-is-internal action nil t)))
|
(or (when-let* ((key (where-is-internal action nil t)))
|
||||||
(propertize (with-temp-buffer
|
(with-temp-buffer
|
||||||
(save-excursion (insert (key-description key)))
|
(save-excursion (insert (key-description key)))
|
||||||
(while (re-search-forward "<\\([^>]+\\)>" nil t)
|
(while (re-search-forward "<\\([^>]+\\)>" nil t)
|
||||||
(replace-match (upcase (substring (match-string 1) 0 3))))
|
(replace-match (upcase (substring (match-string 1) 0 3))))
|
||||||
(buffer-string))
|
(propertize (buffer-string) 'face 'font-lock-constant-face)))
|
||||||
'face 'font-lock-constant-face))
|
|
||||||
""))))
|
""))))
|
||||||
(if (display-graphic-p)
|
(if (display-graphic-p)
|
||||||
"\n\n"
|
"\n\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue