1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Make the lambda/closure buttons in `C-h b' say what they do

* lisp/button.el (buttonize): Add a help-echo property.

* lisp/help.el (help--describe-command): Say what the
lambda/closure buttons do.
This commit is contained in:
Lars Ingebrigtsen 2021-11-06 22:31:06 +01:00
parent b2e9a61bcd
commit de06e05395
2 changed files with 7 additions and 3 deletions

View file

@ -618,14 +618,17 @@ button at point is the button to describe."
(define-obsolete-function-alias 'button-buttonize #'buttonize "29.1")
(defun buttonize (string callback &optional data)
(defun buttonize (string callback &optional data help-echo)
"Make STRING into a button and return it.
When clicked, CALLBACK will be called with the DATA as the
function argument. If DATA isn't present (or is nil), the button
itself will be used instead as the function argument."
itself will be used instead as the function argument.
If HELP-ECHO, use that as the `help-echo' property."
(propertize string
'face 'button
'mouse-face 'highlight
'help-echo help-echo
'button t
'follow-link t
'category t

View file

@ -1347,7 +1347,8 @@ Return nil if the key sequence is too long."
(symbol-name (car definition))
(lambda (_)
(pp-display-expression
definition "*Help Source*" t))))))
definition "*Help Source*" t))
nil "View definition"))))
(t
(insert "??\n"))))