From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: Katsumi Yamaoka <yamaoka@jpl.org>, 64292@debbugs.gnu.org
Subject: bug#64292: 30.0.50; setf strange when lexical-binding is nil
Date: Tue, 27 Jun 2023 09:36:07 -0400 [thread overview]
Message-ID: <jwvttuthvvb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <F653A278-904B-4B95-B978-756D3EAB7096@gmail.com> ("Mattias Engdegård"'s message of "Tue, 27 Jun 2023 15:21:08 +0200")
Mattias Engdegård [2023-06-27 15:21:08] wrote:
>> (setq lexical-binding nil)
>> (require 'nnheader)
>> (macroexpand '(setf (mail-header-date header) date))
>> => (let* ((v #'(lambda (cl-x) (progn (progn (aref cl-x 3)))))
>> (v header))
>> (\(setf\ funcall\) date v v))
>>
>> This looks broken, though it gets normal if lexical-binding is t.
>> Because of this, an old ELisp module doesn't work. In addition,
>> the funny portion is replaced with
>> \(setf\ internal--with-suppressed-warnings\)...
>> if the code is byte-compiled.
>
> This is effectively an encrypted "you should use lexical-binding:t" error message.
> Stefan, should we just bypass the suppression here, or the entire `cl--slet`
> business, in dynbound mode?
Can someone confirm that the patch below reverts the regression?
Stefan
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index aadb498609a..eed7199fcc2 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -247,9 +247,10 @@ cl--slet
"Like `cl--slet*' but for \"parallel let\"."
(let ((dyns nil)) ;Vars declared as dynbound among the bindings?
;; `seq-some' lead to bootstrap problems.
- (dolist (binding bindings)
- (when (macroexp--dynamic-variable-p (car binding))
- (push (car binding) dyns)))
+ (when lexical-binding
+ (dolist (binding bindings)
+ (when (macroexp--dynamic-variable-p (car binding))
+ (push (car binding) dyns))))
(cond
(dyns
(let ((form `(funcall (lambda (,@(mapcar #'car bindings))
next prev parent reply other threads:[~2023-06-27 13:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 1:45 bug#64292: 30.0.50; setf strange when lexical-binding is nil Katsumi Yamaoka
2023-06-27 13:21 ` Mattias Engdegård
2023-06-27 13:36 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-06-28 0:36 ` Katsumi Yamaoka
2023-06-28 13:36 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=jwvttuthvvb.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=64292@debbugs.gnu.org \
--cc=mattias.engdegard@gmail.com \
--cc=monnier@iro.umontreal.ca \
--cc=yamaoka@jpl.org \
/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).