GNU bug report logs - #55914
28.1; Defining as dynamic an already lexical var

Previous Next

Package: emacs;

Reported by: Hendrik Tews <hendrik.tews <at> kernkonzept.com>

Date: Sat, 11 Jun 2022 21:34:01 UTC

Severity: normal

Found in version 28.1

Full log


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

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Hendrik Tews <hendrik.tews <at> kernkonzept.com>
Cc: 55914 <at> debbugs.gnu.org
Subject: Re: bug#55914: 28.1; Defining as dynamic an already lexical var
Date: Sun, 12 Jun 2022 12:10:04 +1200
On 2022-06-12 09:33, Hendrik Tews wrote:
> From this I would conclude that the error is a bug. Or did I
> overlook something in the documentation?

It sounds like it's been upgraded from a mere description to an
error, and the point would be "definitely don't do that; and if
you see this then you should treat it as a bug to be fixed".


> (I noticed this problem because of failing tests for Proof
> General with emacs 28, see
> https://github.com/ProofGeneral/PG/issues/657. There, inside a
> let binding a Coq file is opened, which causes the Coq instance
> of Proof General to be loaded, which somewhere contained a
> defcustom for the variable that was bound with let.)

Which indicates a bug to be fixed, no?

If the variable is *supposed* to be dynamic (everywhere), then
lexical libraries which refer to it must declare (defvar FOO) to
mark it as a dynamic variable, if it's possible that the proper
definition may not yet have been loaded.

If the variable is supposed to be lexical, then it should be
renamed to something which doesn't clash with a dynamic variable.
There's need for hyphenated name-spacing for lexical vars, so the
majority of single-word names are particularly safe to use.





This bug report was last modified 3 years and 3 days ago.

Previous Next


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