changeset 26596:f908261703d3

(Fnthcdr, Fnreverse): Inline cdr. (Fmember, Fdelq, Fdelete): Inline car. (Fy_or_n_p): Doc fix.
author Dave Love <fx@gnu.org>
date Thu, 25 Nov 1999 15:23:23 +0000
parents 829102550ebe
children 424ca4b6d517
files src/fns.c
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Thu Nov 25 15:01:15 1999 +0000
+++ b/src/fns.c	Thu Nov 25 15:23:23 1999 +0000
@@ -1273,7 +1273,9 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
 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\