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/delayed-warnings.html | |
new repository
Diffstat (limited to 'devdocs/elisp/delayed-warnings.html')
| -rw-r--r-- | devdocs/elisp/delayed-warnings.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/devdocs/elisp/delayed-warnings.html b/devdocs/elisp/delayed-warnings.html new file mode 100644 index 00000000..0fecd518 --- /dev/null +++ b/devdocs/elisp/delayed-warnings.html @@ -0,0 +1,20 @@ + <h4 class="subsection">Delayed Warnings</h4> <p>Sometimes, you may wish to avoid showing a warning while a command is running, and only show it only after the end of the command. You can use the function <code>delay-warning</code> for this. </p> <dl> <dt id="delay-warning">Function: <strong>delay-warning</strong> <em>type message &optional level buffer-name</em> +</dt> <dd><p>This function is the delayed counterpart to <code>display-warning</code> (see <a href="warning-basics">Warning Basics</a>), and it is called with the same arguments. The warning message is queued into <code>delayed-warnings-list</code>. </p></dd> +</dl> <dl> <dt id="delayed-warnings-list">Variable: <strong>delayed-warnings-list</strong> +</dt> <dd> +<p>The value of this variable is a list of warnings to be displayed after the current command has finished. Each element must be a list </p> <div class="example"> <pre class="example">(<var>type</var> <var>message</var> [<var>level</var> [<var>buffer-name</var>]]) +</pre> +</div> <p>with the same form, and the same meanings, as the argument list of <code>display-warning</code>. Immediately after running <code>post-command-hook</code> (see <a href="command-overview">Command Overview</a>), the Emacs command loop displays all the warnings specified by this variable, then resets it to <code>nil</code>. </p> +</dd> +</dl> <p>Programs which need to further customize the delayed warnings mechanism can change the variable <code>delayed-warnings-hook</code>: </p> <dl> <dt id="delayed-warnings-hook">Variable: <strong>delayed-warnings-hook</strong> +</dt> <dd> +<p>This is a normal hook which is run by the Emacs command loop, after <code>post-command-hook</code>, in order to process and display delayed warnings. </p> <p>Its default value is a list of two functions: </p> <div class="example"> <pre class="example">(collapse-delayed-warnings display-delayed-warnings) +</pre> +</div> <p>The function <code>collapse-delayed-warnings</code> removes repeated entries from <code>delayed-warnings-list</code>. The function <code>display-delayed-warnings</code> calls <code>display-warning</code> on each of the entries in <code>delayed-warnings-list</code>, in turn, and then sets <code>delayed-warnings-list</code> to <code>nil</code>. </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/Delayed-Warnings.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Delayed-Warnings.html</a> + </p> +</div> |
