From f274311c2cad468abbe4bdbb25362e2fe6ccb5c2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 23 Jul 2013 08:22:16 +0100 Subject: [PATCH] * eval.c (Fprogn): Check that BODY is a proper list. --- etc/NEWS | 8 ++++++++ src/ChangeLog | 2 ++ src/eval.c | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index facadac5c1c..e7d51a4033a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -538,6 +538,14 @@ file using `set-file-extended-attributes'. ** `visited-file-modtime' now returns -1 for nonexistent files. Formerly it returned a list (-1 LOW USEC PSEC), but this was ambiguous in the presence of files with negative time stamps. + +** Special forms with implied progn now check for proper lists. +Starting in Emacs 21.4, a special form with an implied progn of an +improper list ignored the trailing value, treating it as nil. For +example, (cond (t (message "hello") . "there")) ignored the "there". +This inadvertent change to Emacs's behavior has been reverted, and +Emacs now signals an error for these improper forms, as it did in +version 21.3 and earlier. * Lisp Changes in Emacs 24.4 diff --git a/src/ChangeLog b/src/ChangeLog index 3d6725f6cd5..cc8d7f5edee 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2013-07-23 Paul Eggert + * eval.c (Fprogn): Check that BODY is a proper list. + Tune UNEVALLED functions by using XCAR instead of Fcar, etc. * data.c (Fsetq_default): * eval.c (Fif, Fcond, Fprog1, Fsetq, Fquote, Ffunction, Fdefvar) diff --git a/src/eval.c b/src/eval.c index 6cb2b7a92b8..e6ccf0bdcb5 100644 --- a/src/eval.c +++ b/src/eval.c @@ -454,6 +454,12 @@ usage: (progn BODY...) */) body = XCDR (body); } + if (!NILP (body)) + { + /* This can happen if functions like Fcond are the caller. */ + wrong_type_argument (Qlistp, body); + } + UNGCPRO; return val; } -- 2.39.2