Subject: Re: bug#74145: 31.0.50; Default lexical-binding to t

From: Stefan Monnier <[email-masked]>
Date: Tue, 18 Feb 2025 15:23:24 -0500

> They definitely might not understand the differences between the two
> flavors well enough to know what to expect.  For example, warnings
> from the byte compiler about "unused lexical variable" might be
> extremely puzzling if those differences are not well understood,
> because to someone who is used to dynamic binding, the code looks
> 100% legit.

That's what the doc tries to explain:

      A warning about an unused variable may be a good hint that the
    variable was intended to be dynamically scoped (because it is
    actually used, but in another function), but it may also be an
    indication that the variable is simply really not used and could
    simply be removed.  So you need to find out which case it is, and
    based on that, either add a @code{defvar} or remove the variable
    altogether.  If removal is not possible or not desirable (typically
    because it is a formal argument and that we cannot or don't want to
    change all the callers), you can also add a leading underscore to
    the variable's name to indicate to the compiler that this is
    a variable known not to be used.)

- Stefan