changeset 9108:c0287cefc0f8

(record_insert, truncate_undo_list, Fprimitive_undo): Use type test macros.
author Karl Heuer <kwzh@gnu.org>
date Tue, 27 Sep 1994 01:13:35 +0000
parents 46461644055b
children 6e44ddc40153
files src/undo.c
diffstat 1 files changed, 16 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/undo.c	Tue Sep 27 01:11:24 1994 +0000
+++ b/src/undo.c	Tue Sep 27 01:13:35 1994 +0000
@@ -62,13 +62,13 @@
 
   /* If this is following another insertion and consecutive with it
      in the buffer, combine the two.  */
-  if (XTYPE (current_buffer->undo_list) == Lisp_Cons)
+  if (CONSP (current_buffer->undo_list))
     {
       Lisp_Object elt;
       elt = XCONS (current_buffer->undo_list)->car;
-      if (XTYPE (elt) == Lisp_Cons
-	  && XTYPE (XCONS (elt)->car) == Lisp_Int
-	  && XTYPE (XCONS (elt)->cdr) == Lisp_Int
+      if (CONSP (elt)
+	  && INTEGERP (XCONS (elt)->car)
+	  && INTEGERP (XCONS (elt)->cdr)
 	  && XINT (XCONS (elt)->cdr) == XINT (beg))
 	{
 	  XSETINT (XCONS (elt)->cdr, XINT (beg) + XINT (length));
@@ -249,8 +249,7 @@
      Skip, skip, skip the undo, skip, skip, skip the undo,
      Skip, skip, skip the undo, skip to the undo bound'ry. 
      (Get it?  "Skip to my Loo?")  */
-  if (XTYPE (next) == Lisp_Cons
-      && NILP (XCONS (next)->car))
+  if (CONSP (next) && NILP (XCONS (next)->car))
     {
       /* Add in the space occupied by this element and its chain link.  */
       size_so_far += sizeof (struct Lisp_Cons);
@@ -259,18 +258,17 @@
       prev = next;
       next = XCONS (next)->cdr;
     }
-  while (XTYPE (next) == Lisp_Cons
-	 && ! NILP (XCONS (next)->car))
+  while (CONSP (next) && ! NILP (XCONS (next)->car))
     {
       Lisp_Object elt;
       elt = XCONS (next)->car;
 
       /* Add in the space occupied by this element and its chain link.  */
       size_so_far += sizeof (struct Lisp_Cons);
-      if (XTYPE (elt) == Lisp_Cons)
+      if (CONSP (elt))
 	{
 	  size_so_far += sizeof (struct Lisp_Cons);
-	  if (XTYPE (XCONS (elt)->car) == Lisp_String)
+	  if (STRINGP (XCONS (elt)->car))
 	    size_so_far += (sizeof (struct Lisp_String) - 1
 			    + XSTRING (XCONS (elt)->car)->size);
 	}
@@ -279,10 +277,10 @@
       prev = next;
       next = XCONS (next)->cdr;
     }
-  if (XTYPE (next) == Lisp_Cons)
+  if (CONSP (next))
     last_boundary = prev;
 
-  while (XTYPE (next) == Lisp_Cons)
+  while (CONSP (next))
     {
       Lisp_Object elt;
       elt = XCONS (next)->car;
@@ -302,10 +300,10 @@
 
       /* Add in the space occupied by this element and its chain link.  */
       size_so_far += sizeof (struct Lisp_Cons);
-      if (XTYPE (elt) == Lisp_Cons)
+      if (CONSP (elt))
 	{
 	  size_so_far += sizeof (struct Lisp_Cons);
-	  if (XTYPE (XCONS (elt)->car) == Lisp_String)
+	  if (STRINGP (XCONS (elt)->car))
 	    size_so_far += (sizeof (struct Lisp_String) - 1
 			    + XSTRING (XCONS (elt)->car)->size);
 	}
@@ -369,9 +367,9 @@
 	  if (NILP (next))
 	    break;
 	  /* Handle an integer by setting point to that value.  */
-	  if (XTYPE (next) == Lisp_Int)
+	  if (INTEGERP (next))
 	    SET_PT (clip_to_bounds (BEGV, XINT (next), ZV));
-	  else if (XTYPE (next) == Lisp_Cons)
+	  else if (CONSP (next))
 	    {
 	      Lisp_Object car, cdr;
 
@@ -412,7 +410,7 @@
 		  Fput_text_property (beg, end, prop, val, Qnil);
 		}
 #endif /* USE_TEXT_PROPERTIES */
-	      else if (XTYPE (car) == Lisp_Int && XTYPE (cdr) == Lisp_Int)
+	      else if (INTEGERP (car) && INTEGERP (cdr))
 		{
 		  /* Element (BEG . END) means range was inserted.  */
 		  Lisp_Object end;
@@ -425,7 +423,7 @@
 		  Fgoto_char (car);
 		  Fdelete_region (car, cdr);
 		}
-	      else if (XTYPE (car) == Lisp_String && XTYPE (cdr) == Lisp_Int)
+	      else if (STRINGP (car) && INTEGERP (cdr))
 		{
 		  /* Element (STRING . POS) means STRING was deleted.  */
 		  Lisp_Object membuf;