Next: Manipulating Buttons, Previous: Button Types, Up: Buttons
Buttons are associated with a region of text, using an overlay or
text properties to hold button-specific information, all of which are
initialized from the button's type (which defaults to the built-in
button type button). Like all Emacs text, the appearance of
the button is governed by the face property; by default (via
the face property inherited from the button button-type)
this is a simple underline, like a typical web-page link.
For convenience, there are two sorts of button-creation functions,
those that add button properties to an existing region of a buffer,
called make-...button, and those that also insert the button
text, called insert-...button.
The button-creation functions all take the &rest argument
properties, which should be a sequence of property value
pairs, specifying properties to add to the button; see Button Properties. In addition, the keyword argument :type may be
used to specify a button-type from which to inherit other properties;
see Button Types. Any properties not explicitly specified
during creation will be inherited from the button's type (if the type
defines such a property).
The following functions add a button using an overlay (see Overlays) to hold the button properties:
This makes a button from beg to end in the current buffer, and returns it.
This insert a button with the label label at point, and returns it.
The following functions are similar, but use Emacs text properties (see Text Properties) to hold the button properties, making the button actually part of the text instead of being a property of the buffer. Buttons using text properties do not create markers into the buffer, which is important for speed when you use extremely large numbers of buttons. Both functions return the position of the start of the new button:
This makes a button from beg to end in the current buffer, using text properties.
This inserts a button with the label label at point, using text properties.
