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 #12 received at control <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: 19704 <at> debbugs.gnu.org
Cc: Dmitry Gutov <dgutov <at> yandex.ru>
Subject: 25.0.50; funcall with hard-quote inside cl-labels uses the local
 function binding
Date: Thu, 9 Jun 2016 22:37:37 -0400
tag 19704 + patch
found 19704 25.0.94
quit

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

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.