all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 39373@debbugs.gnu.org
Subject: bug#39373: 27.0.50; [PATCH] mode-local-print-bindings broken with lexical-binding
Date: Sat, 1 Feb 2020 22:40:16 +0100	[thread overview]
Message-ID: <C1F1AD4D-F213-4E8E-B667-59D6C9EF8567@acm.org> (raw)
In-Reply-To: <jwv1rre9imh.fsf-monnier+emacs@gnu.org>

1 feb. 2020 kl. 21.15 skrev Stefan Monnier <monnier@iro.umontreal.ca>:

> Compiler macros work when the code passes through `macroexpand-all`, so
> it works when the code is compiled as well as when it's `load`ed (thanks
> to "eager" macroexpansion), but not when it's passed directly to `eval`.

Understood, thank you. (Obviously they aren't expanded when the function is called indirectly, but I didn't find anyone doing that with add-to-list.)

> The message is supposed not to trigger when it's applied to dynamically
> scoped var, but it's probably not 100% reliable.

It appears that the warning triggers (as a hard error, actually) when add-to-list is called directly from a function, but not if it only occurs inside a lambda. All the cases found were inside lambdas (or they would have been fixed long ago).

> BTW, this problem doesn't affect only `add-to-list`.  Other culprits
> include `add-hook`, `run-hooks`, `set`, and `symbol-value`.

Right. I see that some of them are detected by the compiler (in byte-compile-form), but add-to-list is commented out.

The set of functions is a bit open-ended; there is also add-to-ordered-list, add-to-history, etc. Not sure how much text needs to be added for all these. There is a general note about lexical variables and symbol values in the manual, in the section about lexical binding.

> LGTM,

Thanks, pushed to emacs-27.






  reply	other threads:[~2020-02-01 21:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 17:08 bug#39373: 27.0.50; [PATCH] mode-local-print-bindings broken with lexical-binding Mattias Engdegård
2020-01-31 19:27 ` Eli Zaretskii
2020-01-31 19:38   ` Mattias Engdegård
2020-01-31 20:25     ` Eli Zaretskii
2020-01-31 20:51       ` Mattias Engdegård
2020-02-01  7:48         ` Eli Zaretskii
2020-02-01 15:53           ` Drew Adams
2020-02-01 19:24           ` Mattias Engdegård
2020-02-01 19:28             ` Eli Zaretskii
2020-02-01 20:15             ` Stefan Monnier
2020-02-01 21:40               ` Mattias Engdegård [this message]
2020-02-02  3:31                 ` Eli Zaretskii
2020-02-02 11:58                   ` Mattias Engdegård
2020-02-02 13:55                     ` Stefan Monnier
2020-02-02 14:14                       ` Mattias Engdegård
2020-08-09 11:39                         ` Lars Ingebrigtsen
2020-08-09 13:28                           ` Mattias Engdegård
2020-08-09 19:42                             ` Lars Ingebrigtsen

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=C1F1AD4D-F213-4E8E-B667-59D6C9EF8567@acm.org \
    --to=mattiase@acm.org \
    --cc=39373@debbugs.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.