diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/button-buffer-commands.html | |
new repository
Diffstat (limited to 'devdocs/elisp/button-buffer-commands.html')
| -rw-r--r-- | devdocs/elisp/button-buffer-commands.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/devdocs/elisp/button-buffer-commands.html b/devdocs/elisp/button-buffer-commands.html new file mode 100644 index 00000000..6bf21217 --- /dev/null +++ b/devdocs/elisp/button-buffer-commands.html @@ -0,0 +1,15 @@ + <h4 class="subsection">Button Buffer Commands</h4> <p>These are commands and functions for locating and operating on buttons in an Emacs buffer. </p> <p><code>push-button</code> is the command that a user uses to actually push a button, and is bound by default in the button itself to <tt class="key">RET</tt> and to <tt class="key">mouse-2</tt> using a local keymap in the button’s overlay or text properties. Commands that are useful outside the buttons itself, such as <code>forward-button</code> and <code>backward-button</code> are additionally available in the keymap stored in <code>button-buffer-map</code>; a mode which uses buttons may want to use <code>button-buffer-map</code> as a parent keymap for its keymap. Alternatively, the <code>button-mode</code> can be switched on for much the same effect: It’s a minor mode that does nothing else than install <code>button-buffer-map</code> as a minor mode keymap. </p> <p>If the button has a non-<code>nil</code> <code>follow-link</code> property, and <code>mouse-1-click-follows-link</code> is set, a quick <tt class="key">mouse-1</tt> click will also activate the <code>push-button</code> command. See <a href="clickable-text">Clickable Text</a>. </p> <dl> <dt id="push-button">Command: <strong>push-button</strong> <em>&optional pos use-mouse-action</em> +</dt> <dd><p>Perform the action specified by a button at location <var>pos</var>. <var>pos</var> may be either a buffer position or a mouse-event. If <var>use-mouse-action</var> is non-<code>nil</code>, or <var>pos</var> is a mouse-event (see <a href="mouse-events">Mouse Events</a>), 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. <var>pos</var> defaults to point, except when <code>push-button</code> is invoked interactively as the result of a mouse-event, in which case, the mouse event’s position is used. If there’s no button at <var>pos</var>, do nothing and return <code>nil</code>, otherwise return <code>t</code>. </p></dd> +</dl> <dl> <dt id="forward-button">Command: <strong>forward-button</strong> <em>n &optional wrap display-message no-error</em> +</dt> <dd><p>Move to the <var>n</var>th next button, or <var>n</var>th previous button if <var>n</var> is negative. If <var>n</var> is zero, move to the start of any button at point. If <var>wrap</var> is non-<code>nil</code>, moving past either end of the buffer continues from the other end. If <var>display-message</var> is non-<code>nil</code>, the button’s help-echo string is displayed. Any button with a non-<code>nil</code> <code>skip</code> property is skipped over. Returns the button found, and signals an error if no buttons can be found. If <var>no-error</var> is non-<code>nil</code>, return nil instead of signaling the error. </p></dd> +</dl> <dl> <dt id="backward-button">Command: <strong>backward-button</strong> <em>n &optional wrap display-message no-error</em> +</dt> <dd><p>Move to the <var>n</var>th previous button, or <var>n</var>th next button if <var>n</var> is negative. If <var>n</var> is zero, move to the start of any button at point. If <var>wrap</var> is non-<code>nil</code>, moving past either end of the buffer continues from the other end. If <var>display-message</var> is non-<code>nil</code>, the button’s help-echo string is displayed. Any button with a non-<code>nil</code> <code>skip</code> property is skipped over. Returns the button found, and signals an error if no buttons can be found. If <var>no-error</var> is non-<code>nil</code>, return nil instead of signaling the error. </p></dd> +</dl> <dl> <dt id="next-button">Function: <strong>next-button</strong> <em>pos &optional count-current</em> +</dt> <dt id="previous-button">Function: <strong>previous-button</strong> <em>pos &optional count-current</em> +</dt> <dd><p>Return the next button after (for <code>next-button</code>) or before (for <code>previous-button</code>) position <var>pos</var> in the current buffer. If <var>count-current</var> is non-<code>nil</code>, count any button at <var>pos</var> in the search, instead of starting at the next button. </p></dd> +</dl><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 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/Button-Buffer-Commands.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Button-Buffer-Commands.html</a> + </p> +</div> |
