elisp: Manipulating Buttons
37.19.4 Manipulating Buttons
----------------------------
These are functions for getting and setting properties of buttons.
Often these are used by a button’s invocation function to determine what
to do.
Where a BUTTON parameter is specified, it means an object referring
to a specific button, either an overlay (for overlay buttons), or a
buffer-position or marker (for text property buttons). Such an object
is passed as the first argument to a button’s invocation function when
it is invoked.
-- Function: button-start button
Return the position at which BUTTON starts.
-- Function: button-end button
Return the position at which BUTTON ends.
-- Function: button-get button prop
Get the property of button BUTTON named PROP.
-- Function: button-put button prop val
Set BUTTON’s PROP property to VAL.
-- Function: button-activate button &optional use-mouse-action
Call BUTTON’s ‘action’ property (i.e., invoke the function that is
the value of that property, passing it the single argument BUTTON).
If USE-MOUSE-ACTION is non-‘nil’, try to invoke the button’s
‘mouse-action’ property instead of ‘action’; if the button has no
‘mouse-action’ property, use ‘action’ as normal.
-- Function: button-label button
Return BUTTON’s text label.
-- Function: button-type button
Return BUTTON’s button-type.
-- Function: button-has-type-p button type
Return ‘t’ if BUTTON has button-type TYPE, or one of TYPE’s
subtypes.
-- Function: button-at pos
Return the button at position POS in the current buffer, or ‘nil’.
If the button at POS is a text property button, the return value is
a marker pointing to POS.
-- Function: button-type-put type prop val
Set the button-type TYPE’s PROP property to VAL.
-- Function: button-type-get type prop
Get the property of button-type TYPE named PROP.
-- Function: button-type-subtype-p type supertype
Return ‘t’ if button-type TYPE is a subtype of SUPERTYPE.