244 lines
5.2 KiB
HTML
244 lines
5.2 KiB
HTML
|
<!DOCTYPE HTML>
|
||
|
<HTML LANG="en-us"
|
||
|
><HEAD
|
||
|
><TITLE
|
||
|
>muffle-warning | Common Lisp Nova Spec</TITLE
|
||
|
><META CHARSET="US-ASCII"
|
||
|
><LINK REL="canonical" HREF="r_muffle-warning.html"
|
||
|
><LINK REL="next" HREF="r_store-value.html" TYPE="text/html" TITLE="store-value"
|
||
|
><LINK REL="prev" HREF="r_continue.html" TYPE="text/html" TITLE="continue"
|
||
|
><LINK REL="up" HREF="9_2_Conditions_Dictionary.html" TYPE="text/html" TITLE="9.2 Conditions Dictionary"
|
||
|
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
|
||
|
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
|
||
|
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
|
||
|
><SCRIPT SRC="dpans.js%3F3909942064"
|
||
|
></SCRIPT
|
||
|
><SCRIPT SRC="apropos.js%3F3909942064"
|
||
|
></SCRIPT
|
||
|
></HEAD
|
||
|
><BODY
|
||
|
><DIV
|
||
|
><DIV CLASS="topnav"
|
||
|
><DIV CLASS="breadcrumb"
|
||
|
><SPAN CLASS="breadcrumb-item"
|
||
|
><A HREF="index.html"
|
||
|
>Common Lisp Nova Spec</A
|
||
|
></SPAN
|
||
|
> <SPAN CLASS="breadcrumb-item"
|
||
|
>→ <A HREF="9_Conditions.html"
|
||
|
>9. Conditions</A
|
||
|
></SPAN
|
||
|
> <SPAN CLASS="breadcrumb-item"
|
||
|
>→ <A HREF="9_2_Conditions_Dictionary.html"
|
||
|
>9.2 Conditions Dictionary</A
|
||
|
></SPAN
|
||
|
> <SPAN CLASS="breadcrumb-item"
|
||
|
>→ <A HREF="r_muffle-warning.html"
|
||
|
>muffle-warning</A
|
||
|
></SPAN
|
||
|
></DIV
|
||
|
><DIV CLASS="apropos"
|
||
|
><DIV CLASS="apropos-io"
|
||
|
><A HREF="r_continue.html" CLASS="prev"
|
||
|
>←</A
|
||
|
><SPAN ID="apropos-label"
|
||
|
>Apropos </SPAN
|
||
|
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
|
||
|
><A HREF="r_store-value.html" CLASS="next"
|
||
|
>→</A
|
||
|
></DIV
|
||
|
><DIV ID="apropos-res"
|
||
|
></DIV
|
||
|
></DIV
|
||
|
></DIV
|
||
|
><DIV CLASS="matter"
|
||
|
><DIV CLASS="com"
|
||
|
><DIV CLASS="begincom"
|
||
|
><HR
|
||
|
><TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0"
|
||
|
><TR
|
||
|
><TD ALIGN="LEFT" VALIGN="BASELINE" WIDTH="100%" CLASS="name"
|
||
|
><SPAN CLASS="idx" DATA-KIND="idxref" DATA-TERM="muffle-warning"
|
||
|
></SPAN
|
||
|
><B
|
||
|
>muffle-warning</B
|
||
|
></TD
|
||
|
><TD ALIGN="RIGHT" VALIGN="BASELINE" WIDTH="0" NOWRAP="NOWRAP" CLASS="ftype"
|
||
|
><I
|
||
|
>Restart</I
|
||
|
></TD
|
||
|
></TR
|
||
|
></TABLE
|
||
|
><HR
|
||
|
></DIV
|
||
|
><UL CLASS="subtoc"
|
||
|
></UL
|
||
|
><DL
|
||
|
><DT
|
||
|
><B
|
||
|
>Data Arguments Required</B
|
||
|
></DT
|
||
|
><DD
|
||
|
><P CLASS="j"
|
||
|
>None.</P
|
||
|
></DD
|
||
|
><DT
|
||
|
><B
|
||
|
>Description</B
|
||
|
></DT
|
||
|
><DD
|
||
|
><P CLASS="j"
|
||
|
>This <A HREF="26_1_Glossary.html#restart"
|
||
|
><EM CLASS="term"
|
||
|
>restart</EM
|
||
|
></A
|
||
|
> is established by <A HREF="f_warn.html" CLASS="funref"
|
||
|
><B
|
||
|
>warn</B
|
||
|
></A
|
||
|
> so that <A HREF="26_1_Glossary.html#handler"
|
||
|
><EM CLASS="term"
|
||
|
>handlers</EM
|
||
|
></A
|
||
|
> of <A HREF="t_warning.html" CLASS="typeref"
|
||
|
><B
|
||
|
>warning</B
|
||
|
></A
|
||
|
> <A HREF="26_1_Glossary.html#condition"
|
||
|
><EM CLASS="term"
|
||
|
>conditions</EM
|
||
|
></A
|
||
|
> have a way to tell <A HREF="f_warn.html" CLASS="funref"
|
||
|
><B
|
||
|
>warn</B
|
||
|
></A
|
||
|
> that a warning has already been dealt with and that no further action is warranted.</P
|
||
|
></DD
|
||
|
><DT
|
||
|
><B
|
||
|
>Examples</B
|
||
|
></DT
|
||
|
><DD
|
||
|
><PRE CLASS="screen"
|
||
|
> (defvar *all-quiet* nil) <SPAN CLASS="cmsy"
|
||
|
><SPAN CLASS="arrow"
|
||
|
>→</SPAN
|
||
|
></SPAN
|
||
|
> *ALL-QUIET*
|
||
|
(defvar *saved-warnings* '()) <SPAN CLASS="cmsy"
|
||
|
><SPAN CLASS="arrow"
|
||
|
>→</SPAN
|
||
|
></SPAN
|
||
|
> *SAVED-WARNINGS*
|
||
|
(defun quiet-warning-handler (c)
|
||
|
(when *all-quiet*
|
||
|
(let ((r (find-restart 'muffle-warning c)))
|
||
|
(when r
|
||
|
(push c *saved-warnings*)
|
||
|
(invoke-restart r)))))
|
||
|
<SPAN CLASS="cmsy"
|
||
|
><SPAN CLASS="arrow"
|
||
|
>→</SPAN
|
||
|
></SPAN
|
||
|
> CUSTOM-WARNING-HANDLER
|
||
|
(defmacro with-quiet-warnings (&body forms)
|
||
|
`(let ((*all-quiet* t)
|
||
|
(*saved-warnings* '()))
|
||
|
(handler-bind ((warning #'quiet-warning-handler))
|
||
|
,@forms
|
||
|
*saved-warnings*)))
|
||
|
<SPAN CLASS="cmsy"
|
||
|
><SPAN CLASS="arrow"
|
||
|
>→</SPAN
|
||
|
></SPAN
|
||
|
> WITH-QUIET-WARNINGS
|
||
|
(setq saved
|
||
|
(with-quiet-warnings
|
||
|
(warn "Situation #1.")
|
||
|
(let ((*all-quiet* nil))
|
||
|
(warn "Situation #2."))
|
||
|
(warn "Situation #3.")))
|
||
|
<SPAN CLASS="cmr"
|
||
|
>⊳</SPAN
|
||
|
> Warning: Situation #2.
|
||
|
<SPAN CLASS="cmsy"
|
||
|
><SPAN CLASS="arrow"
|
||
|
>→</SPAN
|
||
|
></SPAN
|
||
|
> (#<SIMPLE-WARNING 42744421> #<SIMPLE-WARNING 42744365>)
|
||
|
(dolist (s saved) (format t "~&~A~%" s))
|
||
|
<SPAN CLASS="cmr"
|
||
|
>⊳</SPAN
|
||
|
> Situation #3.
|
||
|
<SPAN CLASS="cmr"
|
||
|
>⊳</SPAN
|
||
|
> Situation #1.
|
||
|
<SPAN CLASS="cmsy"
|
||
|
><SPAN CLASS="arrow"
|
||
|
>→</SPAN
|
||
|
></SPAN
|
||
|
> NIL</PRE
|
||
|
></DD
|
||
|
><DT
|
||
|
><B
|
||
|
>See Also</B
|
||
|
></DT
|
||
|
><DD
|
||
|
><P CLASS="j"
|
||
|
><A HREF="9_1_Condition_System_Concepts.html#sec_9_1_4_2" CLASS="secref"
|
||
|
><SPAN CLASS="cmr"
|
||
|
>Section</SPAN
|
||
|
> <SPAN CLASS="cmr"
|
||
|
>9.1.4.2</SPAN
|
||
|
> <SPAN CLASS="cmr"
|
||
|
>(Restarts)</SPAN
|
||
|
></A
|
||
|
>, <A HREF="9_1_Condition_System_Concepts.html#sec_9_1_4_2_2" CLASS="secref"
|
||
|
><SPAN CLASS="cmr"
|
||
|
>Section</SPAN
|
||
|
> <SPAN CLASS="cmr"
|
||
|
>9.1.4.2.2</SPAN
|
||
|
> <SPAN CLASS="cmr"
|
||
|
>(Interfaces</SPAN
|
||
|
> <SPAN CLASS="cmr"
|
||
|
>to</SPAN
|
||
|
> <SPAN CLASS="cmr"
|
||
|
>Restarts)</SPAN
|
||
|
></A
|
||
|
>, <A HREF="f_invoke-restart.html" CLASS="funref"
|
||
|
><B
|
||
|
>invoke-restart</B
|
||
|
></A
|
||
|
>, <A HREF="f_abort.html" CLASS="funref"
|
||
|
><B
|
||
|
>muffle-warning</B
|
||
|
></A
|
||
|
> (<A HREF="26_1_Glossary.html#function"
|
||
|
><EM CLASS="term"
|
||
|
>function</EM
|
||
|
></A
|
||
|
>), <A HREF="f_warn.html" CLASS="funref"
|
||
|
><B
|
||
|
>warn</B
|
||
|
></A
|
||
|
></P
|
||
|
></DD
|
||
|
></DL
|
||
|
></DIV
|
||
|
></DIV
|
||
|
><DIV CLASS="footer"
|
||
|
><DIV CLASS="btmnav"
|
||
|
><A HREF="r_continue.html" CLASS="prev"
|
||
|
>←</A
|
||
|
><A HREF="r_store-value.html" CLASS="next"
|
||
|
>→</A
|
||
|
></DIV
|
||
|
><DIV CLASS="trail"
|
||
|
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
|
||
|
></DIV
|
||
|
></DIV
|
||
|
><SCRIPT
|
||
|
>domReady();</SCRIPT
|
||
|
></BODY
|
||
|
></HTML
|
||
|
>
|