Commit 087cfbc6 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Add a doc string to with-suppressed-warnings.

parent 30d557da
......@@ -495,7 +495,27 @@ is enabled."
(car (last body)))
(defmacro with-suppressed-warnings (_warnings &rest body)
"Like `progn', but prevents compiler WARNINGS in BODY."
"Like `progn', but prevents compiler WARNINGS in BODY.
WARNINGS is an associative list where the first element of each
list is a warning type, and the rest of the elements in each list
are symbols they apply to. For instance, if you want to suppress
byte compilation warnings about the two obsolete functions `foo'
and `bar', say
\(with-suppressed-warnings ((obsolete foo bar))
The warnings that can be suppressed is a subset of the list in
`byte-compile-warning-types'; see this for a fuller explanation
of these warning types. The types that can be suppressed with
this macro is `free-vars', `callargs', `redefine', `obsolete',
`interactive-only', `lexical', `mapcar', `constants' and
For the `mapcar' case, only the `mapcar' function can be used in
the symbol list. For `suspicious', only `set-buffer' can be used."
(declare (debug (sexp &optional body)) (indent 1))
;; The implementation for the interpreter is basically trivial.
`(progn ,@body))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment