GNU bug report logs - #19704
25.0.50; funcall with hard-quote inside cl-labels uses the local function binding

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Tue, 27 Jan 2015 15:23:01 UTC

Severity: normal

Tags: patch

Found in versions 25.0.50, 25.0.94

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 19704 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>, 19704 <at> debbugs.gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: Re: bug#19704: 25.0.50; funcall with hard-quote inside cl-labels uses
 the local function binding
Date: Sat, 11 Jun 2016 01:06:55 +0300
On 06/10/2016 05:37 AM, Noam Postavsky wrote:

> Seems that macroexp--expand-all got too aggressive, patch below
> teaches it to back off in case of locally defined functions:

Thanks, Noam. Seems to work fine here.

Stefan, how does it look to you?

Eli, can we have it in emacs-25 (it's a regression)?

> diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
> index ed4d6e4..ce5d5dc 100644
> --- a/lisp/emacs-lisp/macroexp.el
> +++ b/lisp/emacs-lisp/macroexp.el
> @@ -261,9 +261,14 @@ macroexp--expand-all
>          (format "%s quoted with ' rather than with #'"
>                  (list 'lambda (nth 1 f) '...))
>          (macroexp--expand-all `(,fun ,arg1 ,f . ,args))))
> -      (`(funcall (,(or 'quote 'function) ,(and f (pred symbolp)) . ,_) . ,args)
> -       ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo'
> -       ;; has a compiler-macro.
> +      ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo'
> +      ;; has a compiler-macro.
> +      (`(funcall (,(or 'quote 'function)
> +                  ,(and f (pred symbolp)
> +                        ;; Unless `foo' is a locally bound macro.
> +                        (guard (not (assq f macroexpand-all-environment))))
> +                  . ,_)
> +                 . ,args)
>         (macroexp--expand-all `(,f . ,args)))
>        (`(,func . ,_)
>         ;; Macro expand compiler macros.  This cannot be delayed to
>





This bug report was last modified 9 years and 38 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.