summaryrefslogtreecommitdiff
path: root/devdocs/elisp/manipulating-buttons.html
blob: 31ae7540386bd5255c447129cb2efc49b3a8a536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 <h4 class="subsection">Manipulating Buttons</h4>  <p>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. </p> <p>Where a <var>button</var> 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. </p> <dl> <dt id="button-start">Function: <strong>button-start</strong> <em>button</em>
</dt> <dd><p>Return the position at which <var>button</var> starts. </p></dd>
</dl> <dl> <dt id="button-end">Function: <strong>button-end</strong> <em>button</em>
</dt> <dd><p>Return the position at which <var>button</var> ends. </p></dd>
</dl> <dl> <dt id="button-get">Function: <strong>button-get</strong> <em>button prop</em>
</dt> <dd><p>Get the property of button <var>button</var> named <var>prop</var>. </p></dd>
</dl> <dl> <dt id="button-put">Function: <strong>button-put</strong> <em>button prop val</em>
</dt> <dd><p>Set <var>button</var>’s <var>prop</var> property to <var>val</var>. </p></dd>
</dl> <dl> <dt id="button-activate">Function: <strong>button-activate</strong> <em>button &amp;optional use-mouse-action</em>
</dt> <dd><p>Call <var>button</var>’s <code>action</code> property (i.e., invoke the function that is the value of that property, passing it the single argument <var>button</var>). If <var>use-mouse-action</var> is non-<code>nil</code>, try to invoke the button’s <code>mouse-action</code> property instead of <code>action</code>; if the button has no <code>mouse-action</code> property, use <code>action</code> as normal. If the <code>button-data</code> property is present in <var>button</var>, use that as the argument for the <code>action</code> function instead of <var>button</var>. </p></dd>
</dl> <dl> <dt id="button-label">Function: <strong>button-label</strong> <em>button</em>
</dt> <dd><p>Return <var>button</var>’s text label. </p></dd>
</dl> <dl> <dt id="button-type">Function: <strong>button-type</strong> <em>button</em>
</dt> <dd><p>Return <var>button</var>’s button-type. </p></dd>
</dl> <dl> <dt id="button-has-type-p">Function: <strong>button-has-type-p</strong> <em>button type</em>
</dt> <dd><p>Return <code>t</code> if <var>button</var> has button-type <var>type</var>, or one of <var>type</var>’s subtypes. </p></dd>
</dl> <dl> <dt id="button-at">Function: <strong>button-at</strong> <em>pos</em>
</dt> <dd><p>Return the button at position <var>pos</var> in the current buffer, or <code>nil</code>. If the button at <var>pos</var> is a text property button, the return value is a marker pointing to <var>pos</var>. </p></dd>
</dl> <dl> <dt id="button-type-put">Function: <strong>button-type-put</strong> <em>type prop val</em>
</dt> <dd><p>Set the button-type <var>type</var>’s <var>prop</var> property to <var>val</var>. </p></dd>
</dl> <dl> <dt id="button-type-get">Function: <strong>button-type-get</strong> <em>type prop</em>
</dt> <dd><p>Get the property of button-type <var>type</var> named <var>prop</var>. </p></dd>
</dl> <dl> <dt id="button-type-subtype-p">Function: <strong>button-type-subtype-p</strong> <em>type supertype</em>
</dt> <dd><p>Return <code>t</code> if button-type <var>type</var> is a subtype of <var>supertype</var>. </p></dd>
</dl><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
    <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Manipulating-Buttons.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Manipulating-Buttons.html</a>
  </p>
</div>