@defmac m4_pattern_forbid (@var{pattern})
@msindex{pattern_forbid}
-Declare that no token matching @var{pattern} must be found in the output.
+Declare that no token matching @var{pattern} must be found in the
+output. The output file is (temporarily) split into one word per line
+as part of the @command{autom4te} post-processing, with each line (and
+therefore word) then being checked against the Perl regular expression
+@var{pattern}. If the regular expression matches, and
+@code{m4_pattern_allow} does not also match, then an error is raised.
+
Comments are not checked; this can be a problem if, for instance, you
have some macro left unexpanded after an @samp{#include}. No consensus
is currently found in the Autoconf community, as some people consider it
documented by @samp{dnl} comments; reserving @samp{#}-comments to
document the output).
+As an example, if you define your own macros that begin with @samp{M_}
+and are composed from capital letters and underscores, the specification
+of @code{m4_pattern_forbid([^M_[A-Z_]+])} will ensure all your macros
+are expanded when not used in comments.
+
As an example of a common use of this macro, consider what happens in
packages that want to use the @command{pkg-config} script via the
third-party @code{PKG_CHECK_MODULES} macro. By default, if a developer
macros locally, they can manage to successfully run @command{autoconf}
on the package, but the resulting @file{configure} file will likely
result in a confusing shell message about a syntax error on the line
-mentioning the unexpanded PKG_CHECK_MODULES macro. On the other hand,
+mentioning the unexpanded @code{PKG_CHECK_MODULES} macro. On the other hand,
if @file{configure.ac} includes @code{m4_pattern_forbid([^PKG_])}, the
missing pkg-config macros will be detected immediately without allowing
@command{autoconf} to succeed.
# m4_pattern_forbid(ERE, [WHY])
# -----------------------------
-# Declare that no token matching the forbidden extended regular
+# Declare that no token matching the forbidden perl extended regular
# expression ERE should be seen in the output unless...
m4_define([m4_pattern_forbid], [])
# m4_pattern_allow(ERE)
# ---------------------
# ... that token also matches the allowed extended regular expression ERE.
-# Both used via traces.
+# Both used via traces, by autom4te post-processing.
m4_define([m4_pattern_allow], [])