# HG changeset patch # User Aidan Kehoe # Date 1325249032 0 # Node ID f5315ccbf00577d58d6613eb030e6f8f11cf7ad5 # Parent 0d05accafc63e15903fc22cb6a0e7f8b3dce3fc5 Cons less, be more careful about always using the environment, #'macroexpand 2011-12-30 Aidan Kehoe * eval.c (Fmacroexpand): Don't cons if ENVIRONMENT is the same object as byte-compile-macro-environment. Always look up symbol- and other macros in the (possibly modified) byte-compile-macro-environment, not the supplied ENVIRONMENT. byte-compile-macro-environment reflects ENVIRONMENT, so that's OK and preferred. diff -r 0d05accafc63 -r f5315ccbf005 src/ChangeLog --- a/src/ChangeLog Wed Dec 28 11:30:47 2011 -0700 +++ b/src/ChangeLog Fri Dec 30 12:43:52 2011 +0000 @@ -1,3 +1,13 @@ +2011-12-30 Aidan Kehoe + + * eval.c (Fmacroexpand): + Don't cons if ENVIRONMENT is the same object as + byte-compile-macro-environment. + Always look up symbol- and other macros in the (possibly modified) + byte-compile-macro-environment, not the supplied ENVIRONMENT. + byte-compile-macro-environment reflects ENVIRONMENT, so that's OK + and preferred. + 2011-12-28 Jerry James * lisp-disunion.h (make_fixnum): avoid losing bits off the left end diff -r 0d05accafc63 -r f5315ccbf005 src/eval.c --- a/src/eval.c Wed Dec 28 11:30:47 2011 -0700 +++ b/src/eval.c Fri Dec 30 12:43:52 2011 +0000 @@ -1565,7 +1565,8 @@ REGISTER Lisp_Object expander, sym, def, tem; int speccount = specpdl_depth (); - if (!NILP (environment)) + if (!NILP (environment) && + !EQ (environment, Vbyte_compile_macro_environment)) { if (NILP (Vbyte_compile_macro_environment)) { @@ -1576,10 +1577,11 @@ specbind (Qbyte_compile_macro_environment, nconc2 (Fcopy_list (environment), Vbyte_compile_macro_environment)); - environment = Vbyte_compile_macro_environment; } } + environment = Vbyte_compile_macro_environment; + while (1) { /* Come back here each time we expand a macro call,