aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorBasil L. Contovounesios2019-09-27 00:04:33 +0100
committerBasil L. Contovounesios2019-10-03 23:05:14 +0100
commit0fc8177414801e428ca184e8a9ba8b79a291c15a (patch)
tree7ed7df57104eee1e0beaa6074efba73670adf3b0 /doc
parent660d509acd9da23d9795b5aaa12a5453e6c61bbd (diff)
downloademacs-0fc8177414801e428ca184e8a9ba8b79a291c15a.tar.gz
emacs-0fc8177414801e428ca184e8a9ba8b79a291c15a.zip
Further improve button.el support for help-echo
The last change to forward-button added support for help-echo values that are functions. This patch fixes the arguments passed to such functions and further adds support for help-echo values that are forms (bug#37515). * doc/lispref/display.texi (Button Properties): Fix description of help-echo button property. * lisp/button.el (button--help-echo): New function. (forward-button): Use it. (backward-button): Clarify help-echo reference in docstring. * test/lisp/button-tests.el (button--help-echo-string) (button--help-echo-form, button--help-echo-function): New tests.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/display.texi19
1 files changed, 14 insertions, 5 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 494bf0d3f7e..61bd4ce8830 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6607,14 +6607,23 @@ in the variable @code{button-map}, which defines @key{RET} and
6607The button type. @xref{Button Types}. 6607The button type. @xref{Button Types}.
6608 6608
6609@item help-echo 6609@item help-echo
6610@kindex help-index @r{(button property)} 6610@kindex help-echo @r{(button property)}
6611A string displayed by the Emacs tool-tip help system; by default, 6611A string displayed by the Emacs tooltip help system; by default,
6612@code{"mouse-2, RET: Push this button"}. 6612@code{"mouse-2, RET: Push this button"}. Alternatively, a function
6613that returns, or a form that evaluates to, a string to be displayed or
6614@code{nil}. For details see @ref{Text help-echo}.
6615
6616The function is called with three arguments, @var{window},
6617@var{object}, and @var{pos}. The second argument, @var{object}, is
6618either the overlay that had the property (for overlay buttons), or the
6619buffer containing the button (for text property buttons). The other
6620arguments have the same meaning as for the special text property
6621@code{help-echo}.
6613 6622
6614@item follow-link 6623@item follow-link
6615@kindex follow-link @r{(button property)} 6624@kindex follow-link @r{(button property)}
6616The follow-link property, defining how a @key{mouse-1} click behaves 6625The @code{follow-link} property, defining how a @key{mouse-1} click
6617on this button, @xref{Clickable Text}. 6626behaves on this button, @xref{Clickable Text}.
6618 6627
6619@item button 6628@item button
6620@kindex button @r{(button property)} 6629@kindex button @r{(button property)}