GNU bug report logs - #54399
27.2; Problems with (let ((custom-variable ...)) (autoload-function ...))

Previous Next

Package: emacs;

Reported by: Ignacio Casso <ignaciocasso <at> hotmail.com>

Date: Tue, 15 Mar 2022 15:53:02 UTC

Severity: normal

Tags: moreinfo

Found in version 27.2

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ignacio Casso <ignaciocasso <at> hotmail.com>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>,
 Lars Ingebrigtsen <larsi <at> gnus.org>, 54399 <at> debbugs.gnu.org
Subject: Re: bug#54399: 27.2; Problems with (let ((custom-variable ...))
 (autoload-function ...))
Date: Tue, 12 Apr 2022 09:18:03 -0400
>   (setq lexical-binding nil)
>   (let ((another-fresh-var 1))
>     (default-boundp 'another-fresh-var)) ;; I expect nil, it returns t

This means you misunderstand dynamic scoping or the meaning of
"default-" in `default-boundp` (it has nothing to do with let bindings
but is only concerned about buffer-local or not).

If you disregard lexical scoping, there are kinda to dimensions to
locality of variables: there's the "let" locality and there's the
"buffer" locality.  They can be combined.  `default-boundp/set-default`
only differ from `boundp/set` on the "buffer" dimension of locality.

Lexical scoping is yet a different beast because lexical variables have
fundamentally no name, so a lexical binding of variable `foo` has no
relation to what `boundp/set` see when passed `foo` as argument.


        Stefan





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

Previous Next


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