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/keyboard-macros.html | |
new repository
Diffstat (limited to 'devdocs/elisp/keyboard-macros.html')
| -rw-r--r-- | devdocs/elisp/keyboard-macros.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/devdocs/elisp/keyboard-macros.html b/devdocs/elisp/keyboard-macros.html new file mode 100644 index 00000000..ed64c45f --- /dev/null +++ b/devdocs/elisp/keyboard-macros.html @@ -0,0 +1,22 @@ + <h3 class="section">Keyboard Macros</h3> <p>A <em>keyboard macro</em> is a canned sequence of input events that can be considered a command and made the definition of a key. The Lisp representation of a keyboard macro is a string or vector containing the events. Don’t confuse keyboard macros with Lisp macros (see <a href="macros">Macros</a>). </p> <dl> <dt id="execute-kbd-macro">Function: <strong>execute-kbd-macro</strong> <em>kbdmacro &optional count loopfunc</em> +</dt> <dd> +<p>This function executes <var>kbdmacro</var> as a sequence of events. If <var>kbdmacro</var> is a string or vector, then the events in it are executed exactly as if they had been input by the user. The sequence is <em>not</em> expected to be a single key sequence; normally a keyboard macro definition consists of several key sequences concatenated. </p> <p>If <var>kbdmacro</var> is a symbol, then its function definition is used in place of <var>kbdmacro</var>. If that is another symbol, this process repeats. Eventually the result should be a string or vector. If the result is not a symbol, string, or vector, an error is signaled. </p> <p>The argument <var>count</var> is a repeat count; <var>kbdmacro</var> is executed that many times. If <var>count</var> is omitted or <code>nil</code>, <var>kbdmacro</var> is executed once. If it is 0, <var>kbdmacro</var> is executed over and over until it encounters an error or a failing search. </p> <p>If <var>loopfunc</var> is non-<code>nil</code>, it is a function that is called, without arguments, prior to each iteration of the macro. If <var>loopfunc</var> returns <code>nil</code>, then this stops execution of the macro. </p> <p>See <a href="reading-one-event">Reading One Event</a>, for an example of using <code>execute-kbd-macro</code>. </p> +</dd> +</dl> <dl> <dt id="executing-kbd-macro">Variable: <strong>executing-kbd-macro</strong> +</dt> <dd><p>This variable contains the string or vector that defines the keyboard macro that is currently executing. It is <code>nil</code> if no macro is currently executing. A command can test this variable so as to behave differently when run from an executing macro. Do not set this variable yourself. </p></dd> +</dl> <dl> <dt id="defining-kbd-macro">Variable: <strong>defining-kbd-macro</strong> +</dt> <dd> +<p>This variable is non-<code>nil</code> if and only if a keyboard macro is being defined. A command can test this variable so as to behave differently while a macro is being defined. The value is <code>append</code> while appending to the definition of an existing macro. The commands <code>start-kbd-macro</code>, <code>kmacro-start-macro</code> and <code>end-kbd-macro</code> set this variable—do not set it yourself. </p> <p>The variable is always local to the current terminal and cannot be buffer-local. See <a href="multiple-terminals">Multiple Terminals</a>. </p> +</dd> +</dl> <dl> <dt id="last-kbd-macro">Variable: <strong>last-kbd-macro</strong> +</dt> <dd> +<p>This variable is the definition of the most recently defined keyboard macro. Its value is a string or vector, or <code>nil</code>. </p> <p>The variable is always local to the current terminal and cannot be buffer-local. See <a href="multiple-terminals">Multiple Terminals</a>. </p> +</dd> +</dl> <dl> <dt id="kbd-macro-termination-hook">Variable: <strong>kbd-macro-termination-hook</strong> +</dt> <dd><p>This normal hook is run when a keyboard macro terminates, regardless of what caused it to terminate (reaching the macro end or an error which ended the macro prematurely). </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/Keyboard-Macros.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Keyboard-Macros.html</a> + </p> +</div> |
