unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: michael_heerdegen@web.de, 46387@debbugs.gnu.org
Subject: bug#46387: 28.0.50; Compiled code making a variable dynamic stopped working
Date: Tue, 09 Feb 2021 10:31:24 -0500	[thread overview]
Message-ID: <jwvim71s1m4.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <B18B1DE2-0340-4A51-9B3D-8489C31C7F15@acm.org> ("Mattias Engdegård"'s message of "Tue, 9 Feb 2021 11:32:58 +0100")

> There's a lack of clarity regarding the exact semantics of local
> `defvar`. The manual says that its effect is confined to the current
> lexical scope, but what exactly does that mean?

Adding a variable to the context creates a new scope.
A `progn` should not introduce a new scope.

> As it turns out, parts of the implementation have different opinions
> about that.

Indeed, there's a fair bit a space between my above two statements.

> As you observed, the recently added optimisation on master takes
> a strict syntactic view: even a `progn` is a lexical scope,

I think that's clearly an error.  Adding/removing `progn` shouldn't make
any difference in this respect.

> (Stefan, it looks like your latest Gnus patch may fall in the same trap. Or?)

The (with-suppressed-warnings (...) (defvar)) form is used at
several places.  It's the preferred way to declare a variable
dynamically scoped without incurring the "not prefixed" warning and
without making the `with-suppressed-warnings` silencer cover more code
than intended.


        Stefan






  reply	other threads:[~2021-02-09 15:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 17:29 bug#46387: 28.0.50; Compiled code making a variable dynamic stopped working Michael Heerdegen
2021-02-09 10:32 ` Mattias Engdegård
2021-02-09 15:31   ` Stefan Monnier [this message]
2021-02-09 16:49     ` Mattias Engdegård
2021-02-09 18:48       ` Stefan Monnier
2021-02-10  3:20   ` Michael Heerdegen
2021-02-10  8:22     ` Mattias Engdegård
2021-02-10 13:49       ` Mattias Engdegård
2021-02-10 22:44         ` Michael Heerdegen
2021-02-11  8:49           ` Mattias Engdegård

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvim71s1m4.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=46387@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    --cc=michael_heerdegen@web.de \
    /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 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).