From: Eli Zaretskii <eliz@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: monnier@iro.umontreal.ca, aaronjensen@gmail.com, 67991@debbugs.gnu.org
Subject: bug#67991: 30.0.50; boundp always returns nil in format-mode-line with let* after 0fde935
Date: Sun, 24 Dec 2023 09:45:41 +0200 [thread overview]
Message-ID: <83cyuwcaca.fsf@gnu.org> (raw)
In-Reply-To: <m2frzsdqe4.fsf@Pro.fritz.box> (message from Gerd Möllmann on Sun, 24 Dec 2023 08:13:39 +0100)
> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: Aaron Jensen <aaronjensen@gmail.com>, monnier@iro.umontreal.ca,
> 67991@debbugs.gnu.org
> Date: Sun, 24 Dec 2023 08:13:39 +0100
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > This one will return t:
> >
> > (format-mode-line
> > '(:eval (progn
> > (defvar some-var)
> > (let* ((some-var "some-value")
> > (_ (message "Bound: %S" (boundp 'some-var))))
> > (message "Var: %S, Bound: %S" some-var (boundp 'some-var))))))
> >
>
> Indeed. Looking at Fdefvar, one can see that a "(defvar foo)" does this
> when lexical-binding is t
>
> /* A simple (defvar foo) with lexical scoping does "nothing" except
> declare that var to be dynamically scoped *locally* (i.e. within
> the current file or let-block). */
>
> while it does nothing at all if lexical-binding is nil. Maybe defvar's
> doc string could give some hint to that. This sentence at least is not
> true for "(defvar SYMBOL)":
>
> The ‘defvar’ form also declares the variable as "special",
> so that it is always dynamically bound even if ‘lexical-binding’ is t.
Thanks, I hope I clarified the doc string now.
next prev parent reply other threads:[~2023-12-24 7:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-23 14:51 bug#67991: 30.0.50; boundp always returns nil in format-mode-line with let* after 0fde935 Aaron Jensen
2023-12-23 15:09 ` Eli Zaretskii
2023-12-23 15:21 ` Gerd Möllmann
2023-12-23 15:52 ` Aaron Jensen
2023-12-23 16:13 ` Gerd Möllmann
2023-12-23 16:42 ` Eli Zaretskii
2023-12-24 7:13 ` Gerd Möllmann
2023-12-24 7:45 ` Eli Zaretskii [this message]
2023-12-24 8:05 ` Gerd Möllmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83cyuwcaca.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=67991@debbugs.gnu.org \
--cc=aaronjensen@gmail.com \
--cc=gerd.moellmann@gmail.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.