all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Noam Postavsky <npostavs@users.sourceforge.net>, 19704@debbugs.gnu.org
Cc: Stefan Monnier <monnier@IRO.UMontreal.CA>
Subject: 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	[thread overview]
Message-ID: <a5036f66-db68-90b3-dd2f-fa99d9ccefe5@yandex.ru> (raw)
In-Reply-To: <CAM-tV-9jBTmYXLD7N_UiwtbjNvWaW-fcX4W-yHcXsvsJA2jkbA@mail.gmail.com>

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
>






  reply	other threads:[~2016-06-10 22:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-27 15:22 bug#19704: 25.0.50; funcall with hard-quote inside cl-labels uses the local function binding Dmitry Gutov
2016-06-10  2:37 ` Noam Postavsky
2016-06-10 22:06   ` Dmitry Gutov [this message]
2016-06-11  2:42     ` Stefan Monnier
2016-06-11  2:56       ` Noam Postavsky
2016-06-11 21:38         ` Stefan Monnier

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=a5036f66-db68-90b3-dd2f-fa99d9ccefe5@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=19704@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=npostavs@users.sourceforge.net \
    /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.