all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, Aaron Jensen <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 08:13:39 +0100	[thread overview]
Message-ID: <m2frzsdqe4.fsf@Pro.fritz.box> (raw)
In-Reply-To: <83msu0dg5p.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Dec 2023 18:42:26 +0200")

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.





  reply	other threads:[~2023-12-24  7:13 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 [this message]
2023-12-24  7:45         ` Eli Zaretskii
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=m2frzsdqe4.fsf@Pro.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=67991@debbugs.gnu.org \
    --cc=aaronjensen@gmail.com \
    --cc=eliz@gnu.org \
    --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.