From 8450690adc64e9e5b0662e32676a6342a1fdd0f0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 10 Nov 1995 06:34:09 +0000 Subject: [PATCH] (syms_of_callint): Set up Qlet, Qletx, Qsave_excursion. (Fcall_interactively): Look past those special forms when checking for a call to `list'. --- src/callint.c | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/src/callint.c b/src/callint.c index 7519d42521d..231de94c3f0 100644 --- a/src/callint.c +++ b/src/callint.c @@ -41,7 +41,7 @@ Lisp_Object Vmark_even_if_inactive; Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; -Lisp_Object Qlist; +Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion; static Lisp_Object preserved_fns; /* Marker used within call-interactively to refer to point. */ @@ -302,22 +302,36 @@ Otherwise, this is done only if an arg is read using the minibuffer.") look for elements that were computed with (region-beginning) or (region-end), and put those expressions into VALUES instead of the present values. */ - car = Fcar (input); - if (EQ (car, Qlist)) + if (CONSP (input)) { - Lisp_Object intail, valtail; - for (intail = Fcdr (input), valtail = values; - CONSP (valtail); - intail = Fcdr (intail), valtail = Fcdr (valtail)) + car = XCONS (input)->car; + /* Skip through certain special forms. */ + while (EQ (car, Qlet) || EQ (car, Qletx) + || EQ (car, Qsave_excursion)) { - Lisp_Object elt; - elt = Fcar (intail); - if (CONSP (elt)) + while (CONSP (XCONS (input)->cdr)) + input = XCONS (input)->cdr; + input = XCONS (input)->car; + if (!CONSP (input)) + break; + car = XCONS (input)->car; + } + if (EQ (car, Qlist)) + { + Lisp_Object intail, valtail; + for (intail = Fcdr (input), valtail = values; + CONSP (valtail); + intail = Fcdr (intail), valtail = Fcdr (valtail)) { - Lisp_Object presflag; - presflag = Fmemq (Fcar (elt), preserved_fns); - if (!NILP (presflag)) - Fsetcar (valtail, Fcar (intail)); + Lisp_Object elt; + elt = Fcar (intail); + if (CONSP (elt)) + { + Lisp_Object presflag; + presflag = Fmemq (Fcar (elt), preserved_fns); + if (!NILP (presflag)) + Fsetcar (valtail, Fcar (intail)); + } } } } @@ -696,6 +710,12 @@ syms_of_callint () Qlist = intern ("list"); staticpro (&Qlist); + Qlet = intern ("let"); + staticpro (&Qlet); + Qletx = intern ("let*"); + staticpro (&Qletx); + Qsave_excursion = intern ("save-excursion"); + staticpro (&Qsave_excursion); Qminus = intern ("-"); staticpro (&Qminus); -- 2.39.2