changeset 85372:f7d19cfed7da

* xselect.c (x_own_selection, x_handle_selection_clear) (x_clear_frame_selections): * w32menu.c (list_of_panes, list_of_items): * w32fns.c (w32_color_map_lookup, Fx_create_frame, Fx_display_list): * textprop.c (validate_plist, interval_has_all_properties) (interval_has_some_properties, interval_has_some_properties_list) (add_properties, text_property_list): * process.c (Fget_buffer_process, list_processes_1, status_notify): * minibuf.c (Fassoc_string): * macselect.c (x_own_selection, x_clear_frame_selections) (Fx_disown_selection_internal): * keymap.c (Fcommand_remapping, where_is_internal, describe_map_tree): Use CONSP rather than !NILP and XC[AD]R rather than Fc[ad]r.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 17 Oct 2007 23:43:52 +0000
parents 8f7b544a943f
children f92b24c347da
files src/ChangeLog src/keymap.c src/macselect.c src/minibuf.c src/process.c src/textprop.c src/w32fns.c src/w32menu.c src/xselect.c
diffstat 9 files changed, 71 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/ChangeLog	Wed Oct 17 23:43:52 2007 +0000
@@ -1,3 +1,19 @@
+2007-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* xselect.c (x_own_selection, x_handle_selection_clear)
+	(x_clear_frame_selections):
+	* w32menu.c (list_of_panes, list_of_items):
+	* w32fns.c (w32_color_map_lookup, Fx_create_frame, Fx_display_list):
+	* textprop.c (validate_plist, interval_has_all_properties)
+	(interval_has_some_properties, interval_has_some_properties_list)
+	(add_properties, text_property_list):
+	* process.c (Fget_buffer_process, list_processes_1, status_notify):
+	* minibuf.c (Fassoc_string):
+	* macselect.c (x_own_selection, x_clear_frame_selections)
+	(Fx_disown_selection_internal):
+	* keymap.c (Fcommand_remapping, where_is_internal, describe_map_tree):
+	Use CONSP rather than !NILP and XC[AD]R rather than Fc[ad]r.
+
 2007-10-17  Chong Yidong  <cyd@stupidchicken.com>
 
 	* process.c: Link to libs for calling res_init() if available.
--- a/src/keymap.c	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/keymap.c	Wed Oct 17 23:43:52 2007 +0000
@@ -1247,9 +1247,9 @@
     {
       Lisp_Object maps, binding;
 
-      for (maps = keymaps; !NILP (maps); maps = Fcdr (maps))
+      for (maps = keymaps; CONSP (maps); maps = XCDR (maps))
 	{
-	  binding = Flookup_key (Fcar (maps), command_remapping_vector, Qnil);
+	  binding = Flookup_key (XCAR (maps), command_remapping_vector, Qnil);
 	  if (!NILP (binding) && !INTEGERP (binding))
 	    return binding;
 	}
@@ -2681,7 +2681,7 @@
       && !NILP (Fcommand_remapping (definition, Qnil, keymaps)))
     RETURN_UNGCPRO (Qnil);
 
-  for (; !NILP (maps); maps = Fcdr (maps))
+  for (; CONSP (maps); maps = XCDR (maps))
     {
       /* Key sequence to reach map, and the map that it reaches */
       register Lisp_Object this, map, tem;
@@ -2693,8 +2693,8 @@
       Lisp_Object last;
       int last_is_meta;
 
-      this = Fcar (Fcar (maps));
-      map  = Fcdr (Fcar (maps));
+      this = Fcar (XCAR (maps));
+      map  = Fcdr (XCAR (maps));
       last = make_number (XINT (Flength (this)) - 1);
       last_is_meta = (XINT (last) >= 0
 		      && EQ (Faref (this, last), meta_prefix_char));
@@ -3179,11 +3179,11 @@
       Lisp_Object list;
 
       /* Delete from MAPS each element that is for the menu bar.  */
-      for (list = maps; !NILP (list); list = XCDR (list))
+      for (list = maps; CONSP (list); list = XCDR (list))
 	{
 	  Lisp_Object elt, prefix, tem;
 
-	  elt = Fcar (list);
+	  elt = XCAR (list);
 	  prefix = Fcar (elt);
 	  if (XVECTOR (prefix)->size >= 1)
 	    {
@@ -3210,11 +3210,11 @@
       something = 1;
     }
 
-  for (; !NILP (maps); maps = Fcdr (maps))
+  for (; CONSP (maps); maps = XCDR (maps))
     {
       register Lisp_Object elt, prefix, tail;
 
-      elt = Fcar (maps);
+      elt = XCAR (maps);
       prefix = Fcar (elt);
 
       sub_shadows = Qnil;
--- a/src/macselect.c	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/macselect.c	Wed Oct 17 23:43:52 2007 +0000
@@ -487,7 +487,7 @@
     if (!NILP (prev_value))
       {
 	Lisp_Object rest;	/* we know it's not the CAR, so it's easy.  */
-	for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+	for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
 	  if (EQ (prev_value, Fcar (XCDR (rest))))
 	    {
 	      XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -619,7 +619,7 @@
     }
 
   /* Delete elements after the beginning of Vselection_alist.  */
-  for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+  for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
     if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest))))))))
       {
 	/* Let random Lisp code notice that the selection has been stolen.  */
@@ -762,7 +762,7 @@
   else
     {
       Lisp_Object rest;
-      for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+      for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
 	if (EQ (local_selection_data, Fcar (XCDR (rest))))
 	  {
 	    XSETCDR (rest, Fcdr (XCDR (rest)));
--- a/src/minibuf.c	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/minibuf.c	Wed Oct 17 23:43:52 2007 +0000
@@ -2110,10 +2110,10 @@
   if (SYMBOLP (key))
     key = Fsymbol_name (key);
 
-  for (tail = list; !NILP (tail); tail = Fcdr (tail))
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
       register Lisp_Object elt, tem, thiscar;
-      elt = Fcar (tail);
+      elt = XCAR (tail);
       thiscar = CONSP (elt) ? XCAR (elt) : elt;
       if (SYMBOLP (thiscar))
 	thiscar = Fsymbol_name (thiscar);
--- a/src/process.c	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/process.c	Wed Oct 17 23:43:52 2007 +0000
@@ -739,9 +739,9 @@
   buf = Fget_buffer (buffer);
   if (NILP (buf)) return Qnil;
 
-  for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
-      proc = Fcdr (Fcar (tail));
+      proc = Fcdr (XCAR (tail));
       if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf))
 	return proc;
     }
@@ -1345,11 +1345,11 @@
   w_buffer = 6;  /* Buffer */
   w_tty = 0;     /* Omit if no ttys */
 
-  for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
       int i;
 
-      proc = Fcdr (Fcar (tail));
+      proc = Fcdr (XCAR (tail));
       p = XPROCESS (proc);
       if (NILP (p->childp))
 	continue;
@@ -1408,11 +1408,11 @@
   Findent_to (i_command, minspace); write_string ("-------", -1);
   write_string ("\n", -1);
 
-  for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
       Lisp_Object symbol;
 
-      proc = Fcdr (Fcar (tail));
+      proc = Fcdr (XCAR (tail));
       p = XPROCESS (proc);
       if (NILP (p->childp))
 	continue;
@@ -6799,12 +6799,12 @@
      that we run, we get called again to handle their status changes.  */
   update_tick = process_tick;
 
-  for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
       Lisp_Object symbol;
       register struct Lisp_Process *p;
 
-      proc = Fcdr (Fcar (tail));
+      proc = Fcdr (XCAR (tail));
       p = XPROCESS (proc);
 
       if (p->tick != p->update_tick)
--- a/src/textprop.c	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/textprop.c	Wed Oct 17 23:43:52 2007 +0000
@@ -201,9 +201,9 @@
     {
       register int i;
       register Lisp_Object tail;
-      for (i = 0, tail = list; !NILP (tail); i++)
+      for (i = 0, tail = list; CONSP (tail); i++)
 	{
-	  tail = Fcdr (tail);
+	  tail = XCDR (tail);
 	  QUIT;
 	}
       if (i & 1)
@@ -226,18 +226,18 @@
   register int found;
 
   /* Go through each element of PLIST.  */
-  for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
+  for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
     {
-      sym1 = Fcar (tail1);
+      sym1 = XCAR (tail1);
       found = 0;
 
       /* Go through I's plist, looking for sym1 */
-      for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
-	if (EQ (sym1, Fcar (tail2)))
+      for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
+	if (EQ (sym1, XCAR (tail2)))
 	  {
 	    /* Found the same property on both lists.  If the
 	       values are unequal, return zero.  */
-	    if (! EQ (Fcar (Fcdr (tail1)), Fcar (Fcdr (tail2))))
+	    if (! EQ (Fcar (XCDR (tail1)), Fcar (XCDR (tail2))))
 	      return 0;
 
 	    /* Property has same value on both lists;  go to next one.  */
@@ -263,13 +263,13 @@
   register Lisp_Object tail1, tail2, sym;
 
   /* Go through each element of PLIST.  */
-  for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
+  for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
     {
-      sym = Fcar (tail1);
+      sym = XCAR (tail1);
 
       /* Go through i's plist, looking for tail1 */
-      for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
-	if (EQ (sym, Fcar (tail2)))
+      for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
+	if (EQ (sym, XCAR (tail2)))
 	  return 1;
     }
 
@@ -287,12 +287,12 @@
   register Lisp_Object tail1, tail2, sym;
 
   /* Go through each element of LIST.  */
-  for (tail1 = list; ! NILP (tail1); tail1 = XCDR (tail1))
+  for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1))
     {
       sym = Fcar (tail1);
 
       /* Go through i's plist, looking for tail1 */
-      for (tail2 = i->plist; ! NILP (tail2); tail2 = XCDR (XCDR (tail2)))
+      for (tail2 = i->plist; CONSP (tail2); tail2 = XCDR (XCDR (tail2)))
 	if (EQ (sym, XCAR (tail2)))
 	  return 1;
     }
@@ -391,21 +391,21 @@
   GCPRO3 (tail1, sym1, val1);
 
   /* Go through each element of PLIST.  */
-  for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
+  for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
     {
-      sym1 = Fcar (tail1);
-      val1 = Fcar (Fcdr (tail1));
+      sym1 = XCAR (tail1);
+      val1 = Fcar (XCDR (tail1));
       found = 0;
 
       /* Go through I's plist, looking for sym1 */
-      for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
-	if (EQ (sym1, Fcar (tail2)))
+      for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
+	if (EQ (sym1, XCAR (tail2)))
 	  {
 	    /* No need to gcpro, because tail2 protects this
 	       and it must be a cons cell (we get an error otherwise).  */
 	    register Lisp_Object this_cdr;
 
-	    this_cdr = Fcdr (tail2);
+	    this_cdr = XCDR (tail2);
 	    /* Found the property.  Now check its value.  */
 	    found = 1;
 
@@ -1965,10 +1965,10 @@
 	  plist = i->plist;
 
 	  if (!NILP (prop))
-	    for (; !NILP (plist); plist = Fcdr (Fcdr (plist)))
-	      if (EQ (Fcar (plist), prop))
+	    for (; CONSP (plist); plist = Fcdr (XCDR (plist)))
+	      if (EQ (XCAR (plist), prop))
 		{
-		  plist = Fcons (prop, Fcons (Fcar (Fcdr (plist)), Qnil));
+		  plist = Fcons (prop, Fcons (Fcar (XCDR (plist)), Qnil));
 		  break;
 		}
 
--- a/src/w32fns.c	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/w32fns.c	Wed Oct 17 23:43:52 2007 +0000
@@ -845,11 +845,11 @@
 
   BLOCK_INPUT;
 
-  for (tail = Vw32_color_map; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vw32_color_map; CONSP (tail); tail = XCDR (tail))
     {
       register Lisp_Object elt, tem;
 
-      elt = Fcar (tail);
+      elt = XCAR (tail);
       if (!CONSP (elt)) continue;
 
       tem = Fcar (elt);
@@ -4450,7 +4450,7 @@
 
   /* All remaining specified parameters, which have not been "used"
      by x_get_arg and friends, now go in the misc. alist of the frame.  */
-  for (tem = parameters; !NILP (tem); tem = XCDR (tem))
+  for (tem = parameters; CONSP (tem); tem = XCDR (tem))
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
@@ -6838,7 +6838,7 @@
   Lisp_Object tail, result;
 
   result = Qnil;
-  for (tail = w32_display_name_list; ! NILP (tail); tail = XCDR (tail))
+  for (tail = w32_display_name_list; CONSP (tail); tail = XCDR (tail))
     result = Fcons (XCAR (XCAR (tail)), result);
 
   return result;
--- a/src/w32menu.c	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/w32menu.c	Wed Oct 17 23:43:52 2007 +0000
@@ -567,10 +567,10 @@
 
   init_menu_items ();
 
-  for (tail = menu; !NILP (tail); tail = Fcdr (tail))
+  for (tail = menu; CONSP (tail); tail = XCDR (tail))
     {
       Lisp_Object elt, pane_name, pane_data;
-      elt = Fcar (tail);
+      elt = XCAR (tail);
       pane_name = Fcar (elt);
       CHECK_STRING (pane_name);
       push_menu_pane (pane_name, Qnil);
@@ -590,9 +590,9 @@
 {
   Lisp_Object tail, item, item1;
 
-  for (tail = pane; !NILP (tail); tail = Fcdr (tail))
+  for (tail = pane; CONSP (tail); tail = XCDR (tail))
     {
-      item = Fcar (tail);
+      item = XCAR (tail);
       if (STRINGP (item))
 	push_menu_item (item, Qnil, Qnil, Qt, Qnil, Qnil, Qnil, Qnil);
       else if (NILP (item))
--- a/src/xselect.c	Wed Oct 17 23:05:54 2007 +0000
+++ b/src/xselect.c	Wed Oct 17 23:43:52 2007 +0000
@@ -442,7 +442,7 @@
     if (!NILP (prev_value))
       {
 	Lisp_Object rest;	/* we know it's not the CAR, so it's easy.  */
-	for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+	for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
 	  if (EQ (prev_value, Fcar (XCDR (rest))))
 	    {
 	      XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -1072,7 +1072,7 @@
   else
     {
       Lisp_Object rest;
-      for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+      for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
 	if (EQ (local_selection_data, Fcar (XCDR (rest))))
 	  {
 	    XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -1153,7 +1153,7 @@
     }
 
   /* Delete elements after the beginning of Vselection_alist.  */
-  for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+  for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
     if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest))))))))
       {
 	/* Let random Lisp code notice that the selection has been stolen.  */