GNU bug report logs - #59057
Emacs 29. Byte compiler sometimes forgets about a defvar.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sat, 5 Nov 2022 18:47:02 UTC

Severity: normal

Full log


Message #23 received at 59057 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 59057 <at> debbugs.gnu.org
Subject: Re: bug#59057: Emacs 29.  Byte compiler sometimes forgets about a
 defvar.
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





This bug report was last modified 2 years and 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.