unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55914: 28.1; Defining as dynamic an already lexical var
@ 2022-06-11 21:33 Hendrik Tews
  2022-06-12  0:10 ` Phil Sainty
  2022-06-12 10:33 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 5+ messages in thread
From: Hendrik Tews @ 2022-06-11 21:33 UTC (permalink / raw)
  To: 55914

Hi,

evaluating

    (let ((test-var nil))
      (eval '(defvar test-var t "XXX")))

works fine in emacs 27 but fails in 28.1 with "Defining as
dynamic an already lexical var", similarly for defcustom instead
of defvar.

The elisp manual 28.1 says in 12.5 Defining Global Variables:

     If SYMBOL is already lexically bound (e.g., if the ‘defvar’ form
     occurs in a ‘let’ form with lexical binding enabled), then ‘defvar’
     sets the dynamic value.

From this I would conclude that the error is a bug. Or did I
overlook something in the documentation?

(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.)

Best regards,

Hendrik Tews







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-12 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-11 21:33 bug#55914: 28.1; Defining as dynamic an already lexical var Hendrik Tews
2022-06-12  0:10 ` Phil Sainty
2022-06-12  2:10   ` Phil Sainty
2022-06-12  8:54   ` Hendrik Tews
2022-06-12 10:33 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).