summaryrefslogtreecommitdiff
path: root/devdocs/elisp/delayed-warnings.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/delayed-warnings.html')
-rw-r--r--devdocs/elisp/delayed-warnings.html20
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 &amp;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 &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/Delayed-Warnings.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Delayed-Warnings.html</a>
+ </p>
+</div>