Commit 8e713be6 authored by Ken Raeburn's avatar Ken Raeburn

Use XCAR and XCDR instead of explicit member references.

parent 70949dac
......@@ -302,16 +302,16 @@ DEFUN ("pixmap-spec-p", Fpixmap_spec_p, Spixmap_spec_p, 1, 1, 0,
return ((STRINGP (object)
|| (CONSP (object)
&& CONSP (XCONS (object)->cdr)
&& CONSP (XCONS (XCONS (object)->cdr)->cdr)
&& NILP (XCONS (XCONS (XCONS (object)->cdr)->cdr)->cdr)
&& (width = XCONS (object)->car, INTEGERP (width))
&& (height = XCONS (XCONS (object)->cdr)->car, INTEGERP (height))
&& STRINGP (XCONS (XCONS (XCONS (object)->cdr)->cdr)->car)
&& CONSP (XCDR (object))
&& CONSP (XCDR (XCDR (object)))
&& NILP (XCDR (XCDR (XCDR (object))))
&& (width = XCAR (object), INTEGERP (width))
&& (height = XCAR (XCDR (object)), INTEGERP (height))
&& STRINGP (XCAR (XCDR (XCDR (object))))
&& XINT (width) > 0
&& XINT (height) > 0
/* The string must have enough bits for width * height. */
&& ((XSTRING (XCONS (XCONS (XCONS (object)->cdr)->cdr)->car)->size
&& ((XSTRING (XCAR (XCDR (XCDR (object))))->size
* (BITS_PER_INT / sizeof (int)))
>= XFASTINT (width) * XFASTINT (height))))
? Qt : Qnil);
......@@ -828,7 +828,7 @@ merge_face_list (f, face, prop)
int j;
if (CONSP (prop)
&& ! STRINGP (XCONS (prop)->cdr))
&& ! STRINGP (XCDR (prop)))
{
/* We have a list of faces, merge them in reverse order. */
......@@ -855,10 +855,10 @@ merge_face_list (f, face, prop)
{
if (CONSP (faces[j]))
{
if (EQ (XCONS (faces[j])->car, Qbackground_color))
face->background = load_color (f, XCONS (faces[j])->cdr);
if (EQ (XCONS (faces[j])->car, Qforeground_color))
face->foreground = load_color (f, XCONS (faces[j])->cdr);
if (EQ (XCAR (faces[j]), Qbackground_color))
face->background = load_color (f, XCDR (faces[j]));
if (EQ (XCAR (faces[j]), Qforeground_color))
face->foreground = load_color (f, XCDR (faces[j]));
}
else
{
......
This diff is collapsed.
......@@ -214,9 +214,9 @@ menubar_id_to_frame (HMENU menu)
Lisp_Object tail, frame;
FRAME_PTR f;
for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
{
frame = XCONS (tail)->car;
frame = XCAR (tail);
if (!GC_FRAMEP (frame))
continue;
f = XFRAME (frame);
......@@ -416,14 +416,14 @@ single_keymap_panes (keymap, pane_name, prefix, notreal, maxdepth)
notbuttons = menu_items_used;
#endif
for (tail = keymap; CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = keymap; CONSP (tail); tail = XCDR (tail))
{
GCPRO2 (keymap, pending_maps);
/* Look at each key binding, and if it is a menu item add it
to this menu. */
item = XCONS (tail)->car;
item = XCAR (tail);
if (CONSP (item))
single_menu_item (XCONS (item)->car, XCONS (item)->cdr,
single_menu_item (XCAR (item), XCDR (item),
&pending_maps, notreal, maxdepth, &notbuttons);
else if (VECTORP (item))
{
......@@ -446,12 +446,12 @@ single_keymap_panes (keymap, pane_name, prefix, notreal, maxdepth)
{
Lisp_Object elt, eltcdr, string;
elt = Fcar (pending_maps);
eltcdr = XCONS (elt)->cdr;
string = XCONS (eltcdr)->car;
eltcdr = XCDR (elt);
string = XCAR (eltcdr);
/* We no longer discard the @ from the beginning of the string here.
Instead, we do this in w32_menu_show. */
single_keymap_panes (Fcar (elt), string,
XCONS (eltcdr)->cdr, notreal, maxdepth - 1);
XCDR (eltcdr), notreal, maxdepth - 1);
pending_maps = Fcdr (pending_maps);
}
}
......@@ -702,7 +702,7 @@ cached information about equivalent key sequences.")
/* Decode the first argument: find the window and the coordinates. */
if (EQ (position, Qt)
|| (CONSP (position) && EQ (XCONS (position)->car, Qmenu_bar)))
|| (CONSP (position) && EQ (XCAR (position), Qmenu_bar)))
{
/* Use the mouse's current position. */
FRAME_PTR new_f = selected_frame;
......@@ -900,7 +900,7 @@ on the left of the dialog box and all following items on the right.\n\
/* Decode the first argument: find the window or frame to use. */
if (EQ (position, Qt)
|| (CONSP (position) && EQ (XCONS (position)->car, Qmenu_bar)))
|| (CONSP (position) && EQ (XCAR (position), Qmenu_bar)))
{
#if 0 /* Using the frame the mouse is on may not be right. */
/* Use the mouse's current position. */
......
......@@ -2068,11 +2068,11 @@ If successful, the new layout id is returned, otherwise nil.")
DWORD kl;
CHECK_CONS (layout, 0);
CHECK_NUMBER (XCONS (layout)->car, 0);
CHECK_NUMBER (XCONS (layout)->cdr, 0);
CHECK_NUMBER (XCAR (layout), 0);
CHECK_NUMBER (XCDR (layout), 0);
kl = (XINT (XCONS (layout)->car) & 0xffff)
| (XINT (XCONS (layout)->cdr) << 16);
kl = (XINT (XCAR (layout)) & 0xffff)
| (XINT (XCDR (layout)) << 16);
/* Synchronize layout with input thread. */
if (dwWindowsThreadId)
......
......@@ -2588,11 +2588,11 @@ x_window_to_scroll_bar (window_id)
for (tail = Vframe_list;
XGCTYPE (tail) == Lisp_Cons;
tail = XCONS (tail)->cdr)
tail = XCDR (tail))
{
Lisp_Object frame, bar, condemned;
frame = XCONS (tail)->car;
frame = XCAR (tail);
/* All elements of Vframe_list should be frames. */
if (! GC_FRAMEP (frame))
abort ();
......@@ -3473,7 +3473,7 @@ w32_read_socket (sd, bufp, numchars, expected)
numchars--;
}
else if (! NILP(Vframe_list)
&& ! NILP (XCONS (Vframe_list)->cdr))
&& ! NILP (XCDR (Vframe_list)))
/* Force a redisplay sooner or later to update the
frame titles in case this is the second frame. */
record_asynch_buffer_change ();
......@@ -4981,7 +4981,7 @@ w32_term_init (display_name, xrm_option, resource_name)
/* Put it on w32_display_name_list as well, to keep them parallel. */
w32_display_name_list = Fcons (Fcons (display_name, Qnil),
w32_display_name_list);
dpyinfo->name_list_element = XCONS (w32_display_name_list)->car;
dpyinfo->name_list_element = XCAR (w32_display_name_list);
dpyinfo->w32_id_name
= (char *) xmalloc (XSTRING (Vinvocation_name)->size
......@@ -5071,22 +5071,22 @@ x_delete_display (dpyinfo)
/* Discard this display from w32_display_name_list and w32_display_list.
We can't use Fdelq because that can quit. */
if (! NILP (w32_display_name_list)
&& EQ (XCONS (w32_display_name_list)->car, dpyinfo->name_list_element))
w32_display_name_list = XCONS (w32_display_name_list)->cdr;
&& EQ (XCAR (w32_display_name_list), dpyinfo->name_list_element))
w32_display_name_list = XCDR (w32_display_name_list);
else
{
Lisp_Object tail;
tail = w32_display_name_list;
while (CONSP (tail) && CONSP (XCONS (tail)->cdr))
while (CONSP (tail) && CONSP (XCDR (tail)))
{
if (EQ (XCONS (XCONS (tail)->cdr)->car,
if (EQ (XCAR (XCDR (tail)),
dpyinfo->name_list_element))
{
XCONS (tail)->cdr = XCONS (XCONS (tail)->cdr)->cdr;
XCDR (tail) = XCDR (XCDR (tail));
break;
}
tail = XCONS (tail)->cdr;
tail = XCDR (tail);
}
}
......
......@@ -351,9 +351,9 @@ x_window_to_frame (dpyinfo, wdesc)
Lisp_Object tail, frame;
struct frame *f;
for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
{
frame = XCONS (tail)->car;
frame = XCAR (tail);
if (!GC_FRAMEP (frame))
continue;
f = XFRAME (frame);
......@@ -389,9 +389,9 @@ x_any_window_to_frame (dpyinfo, wdesc)
struct frame *f;
struct x_output *x;
for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
{
frame = XCONS (tail)->car;
frame = XCAR (tail);
if (!GC_FRAMEP (frame))
continue;
f = XFRAME (frame);
......@@ -427,9 +427,9 @@ x_non_menubar_window_to_frame (dpyinfo, wdesc)
struct frame *f;
struct x_output *x;
for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
{
frame = XCONS (tail)->car;
frame = XCAR (tail);
if (!GC_FRAMEP (frame))
continue;
f = XFRAME (frame);
......@@ -462,9 +462,9 @@ x_menubar_window_to_frame (dpyinfo, wdesc)
struct frame *f;
struct x_output *x;
for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
{
frame = XCONS (tail)->car;
frame = XCAR (tail);
if (!GC_FRAMEP (frame))
continue;
f = XFRAME (frame);
......@@ -491,9 +491,9 @@ x_top_window_to_frame (dpyinfo, wdesc)
struct frame *f;
struct x_output *x;
for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
{
frame = XCONS (tail)->car;
frame = XCAR (tail);
if (!GC_FRAMEP (frame))
continue;
f = XFRAME (frame);
......@@ -1027,18 +1027,18 @@ x_set_frame_parameters (f, alist)
if (leftpos < 0)
f->output_data.x->size_hint_flags |= XNegative;
}
else if (CONSP (left) && EQ (XCONS (left)->car, Qminus)
&& CONSP (XCONS (left)->cdr)
&& INTEGERP (XCONS (XCONS (left)->cdr)->car))
else if (CONSP (left) && EQ (XCAR (left), Qminus)
&& CONSP (XCDR (left))
&& INTEGERP (XCAR (XCDR (left))))
{
leftpos = - XINT (XCONS (XCONS (left)->cdr)->car);
leftpos = - XINT (XCAR (XCDR (left)));
f->output_data.x->size_hint_flags |= XNegative;
}
else if (CONSP (left) && EQ (XCONS (left)->car, Qplus)
&& CONSP (XCONS (left)->cdr)
&& INTEGERP (XCONS (XCONS (left)->cdr)->car))
else if (CONSP (left) && EQ (XCAR (left), Qplus)
&& CONSP (XCDR (left))
&& INTEGERP (XCAR (XCDR (left))))
{
leftpos = XINT (XCONS (XCONS (left)->cdr)->car);
leftpos = XINT (XCAR (XCDR (left)));
}
if (EQ (top, Qminus))
......@@ -1049,18 +1049,18 @@ x_set_frame_parameters (f, alist)
if (toppos < 0)
f->output_data.x->size_hint_flags |= YNegative;
}
else if (CONSP (top) && EQ (XCONS (top)->car, Qminus)
&& CONSP (XCONS (top)->cdr)
&& INTEGERP (XCONS (XCONS (top)->cdr)->car))
else if (CONSP (top) && EQ (XCAR (top), Qminus)
&& CONSP (XCDR (top))
&& INTEGERP (XCAR (XCDR (top))))
{
toppos = - XINT (XCONS (XCONS (top)->cdr)->car);
toppos = - XINT (XCAR (XCDR (top)));
f->output_data.x->size_hint_flags |= YNegative;
}
else if (CONSP (top) && EQ (XCONS (top)->car, Qplus)
&& CONSP (XCONS (top)->cdr)
&& INTEGERP (XCONS (XCONS (top)->cdr)->car))
else if (CONSP (top) && EQ (XCAR (top), Qplus)
&& CONSP (XCDR (top))
&& INTEGERP (XCAR (XCDR (top))))
{
toppos = XINT (XCONS (XCONS (top)->cdr)->car);
toppos = XINT (XCAR (XCDR (top)));
}
......@@ -1205,7 +1205,7 @@ x_report_frame_params (f, alistptr)
(FRAME_VISIBLE_P (f) ? Qt
: FRAME_ICONIFIED_P (f) ? Qicon : Qnil));
store_in_alist (alistptr, Qdisplay,
XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->car);
XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element));
if (f->output_data.x->parent_desc == FRAME_X_DISPLAY_INFO (f)->root_window)
tem = Qnil;
......@@ -1698,11 +1698,11 @@ x_set_cursor_type (f, arg, oldval)
FRAME_DESIRED_CURSOR (f) = BAR_CURSOR;
f->output_data.x->cursor_width = 2;
}
else if (CONSP (arg) && EQ (XCONS (arg)->car, Qbar)
&& INTEGERP (XCONS (arg)->cdr))
else if (CONSP (arg) && EQ (XCAR (arg), Qbar)
&& INTEGERP (XCDR (arg)))
{
FRAME_DESIRED_CURSOR (f) = BAR_CURSOR;
f->output_data.x->cursor_width = XINT (XCONS (arg)->cdr);
f->output_data.x->cursor_width = XINT (XCDR (arg));
}
else
/* Treat anything unknown as "box cursor".
......@@ -1759,7 +1759,7 @@ x_icon_type (f)
tem = assq_no_quit (Qicon_type, f->param_alist);
if (CONSP (tem))
return XCONS (tem)->cdr;
return XCDR (tem);
else
return Qnil;
}
......@@ -2921,18 +2921,18 @@ x_figure_window_size (f, parms)
f->output_data.x->top_pos = 0;
window_prompting |= YNegative;
}
else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qminus)
&& CONSP (XCONS (tem0)->cdr)
&& INTEGERP (XCONS (XCONS (tem0)->cdr)->car))
else if (CONSP (tem0) && EQ (XCAR (tem0), Qminus)
&& CONSP (XCDR (tem0))
&& INTEGERP (XCAR (XCDR (tem0))))
{
f->output_data.x->top_pos = - XINT (XCONS (XCONS (tem0)->cdr)->car);
f->output_data.x->top_pos = - XINT (XCAR (XCDR (tem0)));
window_prompting |= YNegative;
}
else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qplus)
&& CONSP (XCONS (tem0)->cdr)
&& INTEGERP (XCONS (XCONS (tem0)->cdr)->car))
else if (CONSP (tem0) && EQ (XCAR (tem0), Qplus)
&& CONSP (XCDR (tem0))
&& INTEGERP (XCAR (XCDR (tem0))))
{
f->output_data.x->top_pos = XINT (XCONS (XCONS (tem0)->cdr)->car);
f->output_data.x->top_pos = XINT (XCAR (XCDR (tem0)));
}
else if (EQ (tem0, Qunbound))
f->output_data.x->top_pos = 0;
......@@ -2949,18 +2949,18 @@ x_figure_window_size (f, parms)
f->output_data.x->left_pos = 0;
window_prompting |= XNegative;
}
else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qminus)
&& CONSP (XCONS (tem1)->cdr)
&& INTEGERP (XCONS (XCONS (tem1)->cdr)->car))
else if (CONSP (tem1) && EQ (XCAR (tem1), Qminus)
&& CONSP (XCDR (tem1))
&& INTEGERP (XCAR (XCDR (tem1))))
{
f->output_data.x->left_pos = - XINT (XCONS (XCONS (tem1)->cdr)->car);
f->output_data.x->left_pos = - XINT (XCAR (XCDR (tem1)));
window_prompting |= XNegative;
}
else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qplus)
&& CONSP (XCONS (tem1)->cdr)
&& INTEGERP (XCONS (XCONS (tem1)->cdr)->car))
else if (CONSP (tem1) && EQ (XCAR (tem1), Qplus)
&& CONSP (XCDR (tem1))
&& INTEGERP (XCAR (XCDR (tem1))))
{
f->output_data.x->left_pos = XINT (XCONS (XCONS (tem1)->cdr)->car);
f->output_data.x->left_pos = XINT (XCAR (XCDR (tem1)));
}
else if (EQ (tem1, Qunbound))
f->output_data.x->left_pos = 0;
......@@ -3673,8 +3673,8 @@ This function is an internal primitive--use `make-frame' instead.")
}
/* Create fontsets from `global_fontset_alist' before handling fonts. */
for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCONS (tem)->cdr)
fs_register_fontset (f, XCONS (tem)->car);
for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCDR (tem))
fs_register_fontset (f, XCAR (tem));
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
......@@ -5262,10 +5262,10 @@ x_display_info_for_name (name)
for (dpyinfo = x_display_list, names = x_display_name_list;
dpyinfo;
dpyinfo = dpyinfo->next, names = XCONS (names)->cdr)
dpyinfo = dpyinfo->next, names = XCDR (names))
{
Lisp_Object tem;
tem = Fstring_equal (XCONS (XCONS (names)->car)->car, name);
tem = Fstring_equal (XCAR (XCAR (names)), name);
if (!NILP (tem))
return dpyinfo;
}
......@@ -5383,8 +5383,8 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
Lisp_Object tail, result;
result = Qnil;
for (tail = x_display_name_list; ! NILP (tail); tail = XCONS (tail)->cdr)
result = Fcons (XCONS (XCONS (tail)->car)->car, result);
for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail))
result = Fcons (XCAR (XCAR (tail)), result);
return result;
}
......@@ -9591,8 +9591,8 @@ x_create_tip_frame (dpyinfo, parms)
}
/* Create fontsets from `global_fontset_alist' before handling fonts. */
for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCONS (tem)->cdr)
fs_register_fontset (f, XCONS (tem)->car);
for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCDR (tem))
fs_register_fontset (f, XCAR (tem));
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
......
......@@ -211,9 +211,9 @@ menubar_id_to_frame (id)
Lisp_Object tail, frame;
FRAME_PTR f;
for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
{
frame = XCONS (tail)->car;
frame = XCAR (tail);
if (!GC_FRAMEP (frame))
continue;
f = XFRAME (frame);
......@@ -417,14 +417,14 @@ single_keymap_panes (keymap, pane_name, prefix, notreal, maxdepth)
notbuttons = menu_items_used;
#endif
for (tail = keymap; CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = keymap; CONSP (tail); tail = XCDR (tail))
{
GCPRO2 (keymap, pending_maps);
/* Look at each key binding, and if it is a menu item add it
to this menu. */
item = XCONS (tail)->car;
item = XCAR (tail);
if (CONSP (item))
single_menu_item (XCONS (item)->car, XCONS (item)->cdr,
single_menu_item (XCAR (item), XCDR (item),
&pending_maps, notreal, maxdepth, &notbuttons);
else if (VECTORP (item))
{
......@@ -447,12 +447,12 @@ single_keymap_panes (keymap, pane_name, prefix, notreal, maxdepth)
{
Lisp_Object elt, eltcdr, string;
elt = Fcar (pending_maps);
eltcdr = XCONS (elt)->cdr;
string = XCONS (eltcdr)->car;
eltcdr = XCDR (elt);
string = XCAR (eltcdr);
/* We no longer discard the @ from the beginning of the string here.
Instead, we do this in xmenu_show. */
single_keymap_panes (Fcar (elt), string,
XCONS (eltcdr)->cdr, notreal, maxdepth - 1);
XCDR (eltcdr), notreal, maxdepth - 1);
pending_maps = Fcdr (pending_maps);
}
}
......@@ -705,7 +705,7 @@ cached information about equivalent key sequences.")
/* Decode the first argument: find the window and the coordinates. */
if (EQ (position, Qt)
|| (CONSP (position) && EQ (XCONS (position)->car, Qmenu_bar)))
|| (CONSP (position) && EQ (XCAR (position), Qmenu_bar)))
{
/* Use the mouse's current position. */
FRAME_PTR new_f = selected_frame;
......@@ -903,7 +903,7 @@ on the left of the dialog box and all following items on the right.\n\
/* Decode the first argument: find the window or frame to use. */
if (EQ (position, Qt)
|| (CONSP (position) && EQ (XCONS (position)->car, Qmenu_bar)))
|| (CONSP (position) && EQ (XCAR (position), Qmenu_bar)))
{
#if 0 /* Using the frame the mouse is on may not be right. */
/* Use the mouse's current position. */
......
This diff is collapsed.
......@@ -7062,11 +7062,11 @@ x_window_to_scroll_bar (window_id)
for (tail = Vframe_list;
XGCTYPE (tail) == Lisp_Cons;
tail = XCONS (tail)->cdr)
tail = XCDR (tail))
{
Lisp_Object frame, bar, condemned;
frame = XCONS (tail)->car;
frame = XCAR (tail);
/* All elements of Vframe_list should be frames. */
if (! GC_FRAMEP (frame))
abort ();
......@@ -9061,7 +9061,7 @@ XTread_socket (sd, bufp, numchars, expected)
numchars--;
}
else if (! NILP (Vframe_list)
&& ! NILP (XCONS (Vframe_list)->cdr))
&& ! NILP (XCDR (Vframe_list)))
/* Force a redisplay sooner or later
to update the frame titles
in case this is the second frame. */
......@@ -11728,17 +11728,17 @@ x_list_fonts (f, pattern, size, maxnames)
/* We can return any single font matching PATTERN. */
try_XLoadQueryFont = 1;
for (; CONSP (patterns); patterns = XCONS (patterns)->cdr)
for (; CONSP (patterns); patterns = XCDR (patterns))
{
int num_fonts;
char **names;
pattern = XCONS (patterns)->car;
pattern = XCAR (patterns);
/* See if we cached the result for this particular query.
The cache is an alist of the form:
(((PATTERN . MAXNAMES) (FONTNAME . WIDTH) ...) ...)
*/
if (f && (tem = XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr,
if (f && (tem = XCDR (FRAME_X_DISPLAY_INFO (f)->name_list_element),
key = Fcons (pattern, make_number (maxnames)),
!NILP (list = Fassoc (key, tem))))
{
......@@ -11864,30 +11864,30 @@ x_list_fonts (f, pattern, size, maxnames)
/* Now store the result in the cache. */
if (f != NULL)
XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr
XCDR (FRAME_X_DISPLAY_INFO (f)->name_list_element)
= Fcons (Fcons (key, list),
XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr);
XCDR (FRAME_X_DISPLAY_INFO (f)->name_list_element));
label_cached:
if (NILP (list)) continue; /* Try the remaining alternatives. */
newlist = second_best = Qnil;
/* Make a list of the fonts that have the right width. */
for (; CONSP (list); list = XCONS (list)->cdr)
for (; CONSP (list); list = XCDR (list))
{
int found_size;
tem = XCONS (list)->car;
tem = XCAR (list);
if (!CONSP (tem) || NILP (XCONS (tem)->car))
if (!CONSP (tem) || NILP (XCAR (tem)))
continue;
if (!size)
{
newlist = Fcons (XCONS (tem)->car, newlist);
newlist = Fcons (XCAR (tem), newlist);
continue;
}
if (!INTEGERP (XCONS (tem)->cdr))
if (!INTEGERP (XCDR (tem)))
{
/* Since we have not yet known the size of this font, we
must try slow function call XLoadQueryFont. */
......@@ -11896,7 +11896,7 @@ x_list_fonts (f, pattern, size, maxnames)
BLOCK_INPUT;
count = x_catch_errors (dpy);
thisinfo = XLoadQueryFont (dpy,
XSTRING (XCONS (tem)->car)->data);
XSTRING (XCAR (tem))->data);
if (x_had_errors_p (dpy))
{
/* This error is perhaps due to insufficient memory on X
......@@ -11909,7 +11909,7 @@ x_list_fonts (f, pattern, size, maxnames)
if (thisinfo)
{
XCONS (tem)->cdr
XCDR (tem)
= (thisinfo->min_bounds.width == 0
? make_number (0)
: make_number (thisinfo->max_bounds.width));
......@@ -11919,26 +11919,26 @@ x_list_fonts (f, pattern, size, maxnames)
/* For unknown reason, the previous call of XListFont had
returned a font which can't be opened. Record the size
as 0 not to try to open it again. */
XCONS (tem)->cdr = make_number (0);
XCDR (tem) = make_number (0);
}
found_size = XINT (XCONS (tem)->cdr);
found_size = XINT (XCDR (tem));
if (found_size == size)
newlist = Fcons (XCONS (tem)->car, newlist);
newlist = Fcons (XCAR (tem), newlist);
else if (found_size > 0)
{
if (NILP (second_best))
second_best = tem;
else if (found_size < size)
{
if (XINT (XCONS (second_best)->cdr) > size
|| XINT (XCONS (second_best)->cdr) < found_size)
if (XINT (XCDR (second_best)) > size
|| XINT (XCDR (second_best)) < found_size)
second_best = tem;
}
else
{
if (XINT (XCONS (second_best)->cdr) > size
&& XINT (XCONS (second_best)->cdr) > found_size)
if (XINT (XCDR (second_best)) > size
&& XINT (XCDR (second_best)) > found_size)
second_best = tem;
}
}
......@@ -11947,7 +11947,7 @@ x_list_fonts (f, pattern, size, maxnames)
break;
else if (!NILP (second_best))
{
newlist = Fcons (XCONS (second_best)->car, Qnil);
newlist = Fcons (XCAR (second_best), Qnil);
break;
}
}
......@@ -12071,12 +12071,12 @@ x_load_font (f, fontname, size)
int i;
for (i = 0; i < dpyinfo->n_fonts; i++)
for (tail = font_names; CONSP (tail); tail = XCONS (tail)->cdr)
for (tail = font_names; CONSP (tail); tail = XCDR (tail))
if (dpyinfo->font_table[i].name
&& (!strcmp (dpyinfo->font_table[i].name,
XSTRING (XCONS (tail)->car)->data)
XSTRING (XCAR (tail))->data)
|| !strcmp (dpyinfo->font_table[i].full_name,
XSTRING (XCONS (tail)->car)->data)))
XSTRING (XCAR (tail))->data)))
return (dpyinfo->font_table + i);
}
......@@ -12094,7 +12094,7 @@ x_load_font (f, fontname, size)
a bug of not finding a font even if the font surely exists and
is loadable by XLoadQueryFont. */
if (size > 0 && !NILP (font_names))
fontname = (char *) XSTRING (XCONS (font_names)->car)->data;
fontname = (char *) XSTRING (XCAR (font_names))->data;
BLOCK_INPUT;
count = x_catch_errors (FRAME_X_DISPLAY (f));
......@@ -12190,19 +12190,19 @@ x_load_font (f, fontname, size)
Lisp_Object lispy_name = build_string (fontname);
Lisp_Object lispy_full_name = build_string (fontp->full_name);
XCONS (dpyinfo->name_list_element)->cdr
XCDR (dpyinfo->name_list_element)
= Fcons (Fcons (Fcons (lispy_name, make_number (256)),
Fcons (Fcons (lispy_full_name,
make_number (fontp->size)),
Qnil)),
XCONS (dpyinfo->name_list_element)->cdr);
XCDR (dpyinfo->name_list_element));
if (full_name)
XCONS (dpyinfo->name_list_element)->cdr
XCDR (dpyinfo->name_list_element)
= Fcons (Fcons (Fcons (lispy_full_name, make_number (256)),
Fcons (Fcons (lispy_full_name,
make_number (fontp->size)),
Qnil)),
XCONS (dpyinfo->name_list_element)->cdr);
XCDR (dpyinfo->name_list_element));
}
/* The slot `encoding' specifies how to map a character
......@@ -12288,12 +12288,12 @@ x_find_ccl_program (fontp)
{
Lisp_Object list, elt;