From 71a8e74b6e663e9c711563cd49571e501476a62e Mon Sep 17 00:00:00 2001 From: Dave Love Date: Thu, 25 Nov 1999 15:26:37 +0000 Subject: [PATCH] (Fnthcdr, Fnreverse): Inline cdr. (Fmember, Fdelq, Fdelete): Inline car. (Fy_or_n_p): Doc fix. --- src/ChangeLog | 6 ++++++ src/fns.c | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6c23fdb3eb3..8866f8447bc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +1999-11-25 Dave Love + + * fns.c (Fnthcdr, Fnreverse): Inline cdr. + (Fmember, Fdelq, Fdelete): Inline car. + (Fy_or_n_p): Doc fix. + 1999-11-25 Gerd Moellmann * xfaces.c (set_lface_from_font_name): New parameter may_fail_p. diff --git a/src/fns.c b/src/fns.c index 5e70a36831c..201427b830e 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1273,7 +1273,9 @@ DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0, for (i = 0; i < num && !NILP (list); i++) { QUIT; - list = Fcdr (list); + if (! CONSP (list)) + wrong_type_argument (Qlistp, list); + list = XCDR (list); } return list; } @@ -1316,7 +1318,9 @@ The value is actually the tail of LIST whose car is ELT.") for (tail = list; !NILP (tail); tail = XCDR (tail)) { register Lisp_Object tem; - tem = Fcar (tail); + if (! CONSP (tail)) + wrong_type_argument (Qlistp, list); + tem = XCAR (tail); if (! NILP (Fequal (elt, tem))) return tail; QUIT; @@ -1558,7 +1562,9 @@ to be sure of changing the value of `foo'.") prev = Qnil; while (!NILP (tail)) { - tem = Fcar (tail); + if (! CONSP (tail)) + wrong_type_argument (Qlistp, list); + tem = XCAR (tail); if (EQ (elt, tem)) { if (NILP (prev)) @@ -1592,7 +1598,9 @@ to be sure of changing the value of `foo'.") prev = Qnil; while (!NILP (tail)) { - tem = Fcar (tail); + if (! CONSP (tail)) + wrong_type_argument (Qlistp, list); + tem = XCAR (tail); if (! NILP (Fequal (elt, tem))) { if (NILP (prev)) @@ -1622,7 +1630,9 @@ Returns the beginning of the reversed list.") while (!NILP (tail)) { QUIT; - next = Fcdr (tail); + if (! CONSP (tail)) + wrong_type_argument (Qlistp, list); + next = XCDR (tail); Fsetcdr (tail, prev); prev = tail; tail = next; @@ -2551,7 +2561,7 @@ Takes one argument, which is the string to display to ask the question.\n\ It should end in a space; `y-or-n-p' adds `(y or n) ' to it.\n\ No confirmation of the answer is requested; a single character is enough.\n\ Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses\n\ -the bindings in query-replace-map; see the documentation of that variable\n\ +the bindings in `query-replace-map'; see the documentation of that variable\n\ for more information. In this case, the useful bindings are `act', `skip',\n\ `recenter', and `quit'.\)\n\ \n\ -- 2.39.5