From: Noam Postavsky <npostavs@gmail.com>
To: Aidan Kehoe <kehoea@parhasard.net>
Cc: 31792@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#31792: 27.0.50; Regression in #'labels, recent versions
Date: Tue, 12 Jun 2018 18:58:29 -0400 [thread overview]
Message-ID: <87k1r3y5m2.fsf@gmail.com> (raw)
In-Reply-To: <878t7kzyqs.fsf@gmail.com> (Noam Postavsky's message of "Mon, 11 Jun 2018 19:31:39 -0400")
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
tags 31792 + patch
quit
> Seems to have regressed in Emacs 25, cl-labels still works correctly.
> Here's a smaller reproducer:
>
> (labels ((foo () t))
> #'foo) ;=> foo
>
> (cl-labels ((foo () t))
> #'foo) ;=> (lambda nil t)
It looks like `labels' missed the update in [1: 69f36afa11], here's a
patch to apply it. It's not immediately clear to me if the requirement
to use a backquoted lambda vs closure is based on using lexical scoping
where the macro is defined or where it's used, so I left that as is.
Should be fine for emacs-26, I think.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1137 bytes --]
From aa197176d0de4a6b7d1ee5d16d0fc1750f7237cf Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Tue, 12 Jun 2018 18:41:46 -0400
Subject: [PATCH] Fix #'fun handling inside `labels' (Bug#31792)
* lisp/emacs-lisp/cl.el (labels): Apply the equivalent of the
cl-labels change from 2015-01-16 "* lisp/emacs-lisp/cl-macs.el: Fix
last change".
---
lisp/emacs-lisp/cl.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index d53c8e0bbc..85deb8cb4f 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -466,8 +466,9 @@ labels
(push var sets)
(push (cons (car binding)
`(lambda (&rest cl-labels-args)
- (cl-list* 'funcall ',var
- cl-labels-args)))
+ (if (eq (car cl-labels-args) cl--labels-magic)
+ (list cl--labels-magic ',var)
+ (cl-list* 'funcall ',var cl-labels-args))))
newenv)))
(macroexpand-all `(lexical-let ,vars (setq ,@sets) ,@body) newenv)))
--
2.11.0
[-- Attachment #3: Type: text/plain, Size: 191 bytes --]
[1: 69f36afa11]: 2015-01-16 17:49:00 -0500
* lisp/emacs-lisp/cl-macs.el: Fix last change.
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=69f36afa11c0b754c40f4fc57408ccd85428e2b0
next prev parent reply other threads:[~2018-06-12 22:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 23:11 bug#31792: 27.0.50; Regression in #'labels, recent versions Aidan Kehoe
2018-06-11 23:31 ` Noam Postavsky
2018-06-12 22:58 ` Noam Postavsky [this message]
2018-06-13 13:16 ` Stefan Monnier
2018-06-14 3:24 ` Noam Postavsky
2018-06-14 3:32 ` Stefan Monnier
2018-06-14 4:13 ` Noam Postavsky
2018-06-14 18:05 ` Stefan Monnier
2018-06-20 0:08 ` Noam Postavsky
[not found] ` <mailman.1699.1528759928.1292.bug-gnu-emacs@gnu.org>
2018-06-13 16:57 ` Alan Mackenzie
2018-06-13 17:03 ` Noam Postavsky
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=87k1r3y5m2.fsf@gmail.com \
--to=npostavs@gmail.com \
--cc=31792@debbugs.gnu.org \
--cc=kehoea@parhasard.net \
--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.