Subject: bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar.

From: Stefan Monnier <[email-masked]>
Date: Tue, 08 Nov 2022 09:12:38 -0500

> The recently introduced special handling of defvar without a value is
> not welcome.

`defvar` without a value has been treated specially (more specifically
as a pure compiler-directive with no run-time effect) since at least
Emacs-19.34, so I'm not sure "recently" can be applied here.

> Why should anybody want a dynamic variable later to be
> a lexically scoped variable?.  

E.g. for historical reasons `calendar.el` needs to bind dynamically the
variable `date` around some calls to `eval` and to `run-hooks` because
the code evaluated therein has been defined and documented for may years
before to have access to important info via those dynbound vars.

Yet, we don't want `date` to be globally declared as being
always dynbound just because of that package's mishap, do we?

Similar situations affect other innocent-looking vars in other packages.

        Stefan