diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-11 14:25:20 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-11 14:25:20 +0100 |
commit | 14ffab8263eb219fe0c49ad4e0a3476316c542c0 (patch) | |
tree | cd74acd5d034c118c6fde1b8a4e578f435b6000d /doc | |
parent | df769c2effabb62afcf9fdf02185b1dc2638818c (diff) | |
download | emacs-14ffab8263eb219fe0c49ad4e0a3476316c542c0.tar.gz |
Add a new function `button-buttonize'
* doc/lispref/display.texi (Manipulating Buttons): Document it.
* lisp/button.el (button-buttonize): Implement it.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lispref/display.texi | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index ed26ae88087..590b54668f7 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -6881,6 +6881,16 @@ This inserts a button with the label @var{label} at point, using text properties. @end defun +@defun button-buttonize string callback &optional data +Sometimes it's more convenient to make a string into a button without +inserting it into a buffer immediately, for instance when creating +data structures that may then, later, be inserted into a buffer. This +function makes @var{string} into such a string, and @var{callback} +will be called when the user clicks on the button. The optional +@var{data} parameter will be used as the parameter when @var{callback} +is called. If @code{nil}, the button is used as the parameter instead. +@end defun + @node Manipulating Buttons @subsection Manipulating Buttons @cindex manipulating buttons |