+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.
{
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;
}
&& !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;
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));
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)
{
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;
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)));
}
/* 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. */
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)));
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);
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;
}
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;
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;
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)
{
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)
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. */
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;
}
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;
}
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;
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;
}
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);
/* 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);
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;
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);
{
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))
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)));
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)));
}
/* 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. */