From 4f18a4ed84d7268090a92a194dcda40cae1197dd Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 7 Jun 2012 22:47:26 -0400 Subject: [PATCH] * src/eval.c (Fmacroexpand): Stop if the macro returns the same form. --- src/ChangeLog | 4 ++++ src/eval.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3acf12e4483..e16da43761f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-06-08 Stefan Monnier + + * eval.c (Fmacroexpand): Stop if the macro returns the same form. + 2012-06-07 Paul Eggert * doprnt.c (doprnt): Truncate multibyte char correctly. diff --git a/src/eval.c b/src/eval.c index 1da841a4073..85ff3ae19e6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1020,7 +1020,13 @@ definitions to shadow the loaded ones for use in file byte-compilation. */) if (NILP (expander)) break; } - form = apply1 (expander, XCDR (form)); + { + Lisp_Object newform = apply1 (expander, XCDR (form)); + if (EQ (form, newform)) + break; + else + form = newform; + } } return form; } -- 2.39.2