comparison src/xterm.c @ 39973:579177964efa

Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting with lisp system changes.
author Ken Raeburn <raeburn@raeburn.org>
date Tue, 16 Oct 2001 09:09:51 +0000
parents df00f7799bb7
children eac4e9ae201c
comparison
equal deleted inserted replaced
39972:b2479b43184b 39973:579177964efa
13712 UNBLOCK_INPUT; 13712 UNBLOCK_INPUT;
13713 } 13713 }
13714 } 13714 }
13715 13715
13716 /* Now store the result in the cache. */ 13716 /* Now store the result in the cache. */
13717 XCDR (dpyinfo->name_list_element) 13717 XSETCDR (dpyinfo->name_list_element,
13718 = Fcons (Fcons (key, list), XCDR (dpyinfo->name_list_element)); 13718 Fcons (Fcons (key, list), XCDR (dpyinfo->name_list_element)));
13719 13719
13720 label_cached: 13720 label_cached:
13721 if (NILP (list)) continue; /* Try the remaining alternatives. */ 13721 if (NILP (list)) continue; /* Try the remaining alternatives. */
13722 13722
13723 newlist = second_best = Qnil; 13723 newlist = second_best = Qnil;
13756 x_uncatch_errors (dpy, count); 13756 x_uncatch_errors (dpy, count);
13757 UNBLOCK_INPUT; 13757 UNBLOCK_INPUT;
13758 13758
13759 if (thisinfo) 13759 if (thisinfo)
13760 { 13760 {
13761 XCDR (tem) 13761 XSETCDR (tem,
13762 = (thisinfo->min_bounds.width == 0 13762 (thisinfo->min_bounds.width == 0
13763 ? make_number (0) 13763 ? make_number (0)
13764 : make_number (thisinfo->max_bounds.width)); 13764 : make_number (thisinfo->max_bounds.width)));
13765 BLOCK_INPUT; 13765 BLOCK_INPUT;
13766 XFreeFont (dpy, thisinfo); 13766 XFreeFont (dpy, thisinfo);
13767 UNBLOCK_INPUT; 13767 UNBLOCK_INPUT;
13768 } 13768 }
13769 else 13769 else
13770 /* For unknown reason, the previous call of XListFont had 13770 /* For unknown reason, the previous call of XListFont had
13771 returned a font which can't be opened. Record the size 13771 returned a font which can't be opened. Record the size
13772 as 0 not to try to open it again. */ 13772 as 0 not to try to open it again. */
13773 XCDR (tem) = make_number (0); 13773 XSETCDR (tem, make_number (0));
13774 } 13774 }
13775 13775
13776 found_size = XINT (XCDR (tem)); 13776 found_size = XINT (XCDR (tem));
13777 if (found_size == size) 13777 if (found_size == size)
13778 newlist = Fcons (XCAR (tem), newlist); 13778 newlist = Fcons (XCAR (tem), newlist);
14034 Lisp_Object lispy_name = build_string (fontname); 14034 Lisp_Object lispy_name = build_string (fontname);
14035 Lisp_Object lispy_full_name = build_string (fontp->full_name); 14035 Lisp_Object lispy_full_name = build_string (fontp->full_name);
14036 Lisp_Object key = Fcons (Fcons (lispy_name, make_number (256)), 14036 Lisp_Object key = Fcons (Fcons (lispy_name, make_number (256)),
14037 Qnil); 14037 Qnil);
14038 14038
14039 XCDR (dpyinfo->name_list_element) 14039 XSETCDR (dpyinfo->name_list_element,
14040 = Fcons (Fcons (key, 14040 Fcons (Fcons (key,
14041 Fcons (Fcons (lispy_full_name, 14041 Fcons (Fcons (lispy_full_name,
14042 make_number (fontp->size)), 14042 make_number (fontp->size)),
14043 Qnil)), 14043 Qnil)),
14044 XCDR (dpyinfo->name_list_element)); 14044 XCDR (dpyinfo->name_list_element)));
14045 if (full_name) 14045 if (full_name)
14046 { 14046 {
14047 key = Fcons (Fcons (lispy_full_name, make_number (256)), 14047 key = Fcons (Fcons (lispy_full_name, make_number (256)),
14048 Qnil); 14048 Qnil);
14049 XCDR (dpyinfo->name_list_element) 14049 XSETCDR (dpyinfo->name_list_element,
14050 = Fcons (Fcons (key, 14050 Fcons (Fcons (key,
14051 Fcons (Fcons (lispy_full_name, 14051 Fcons (Fcons (lispy_full_name,
14052 make_number (fontp->size)), 14052 make_number (fontp->size)),
14053 Qnil)), 14053 Qnil)),
14054 XCDR (dpyinfo->name_list_element)); 14054 XCDR (dpyinfo->name_list_element)));
14055 } 14055 }
14056 } 14056 }
14057 14057
14058 /* The slot `encoding' specifies how to map a character 14058 /* The slot `encoding' specifies how to map a character
14059 code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to 14059 code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to
14620 tail = x_display_name_list; 14620 tail = x_display_name_list;
14621 while (CONSP (tail) && CONSP (XCDR (tail))) 14621 while (CONSP (tail) && CONSP (XCDR (tail)))
14622 { 14622 {
14623 if (EQ (XCAR (XCDR (tail)), dpyinfo->name_list_element)) 14623 if (EQ (XCAR (XCDR (tail)), dpyinfo->name_list_element))
14624 { 14624 {
14625 XCDR (tail) = XCDR (XCDR (tail)); 14625 XSETCDR (tail, XCDR (XCDR (tail)));
14626 break; 14626 break;
14627 } 14627 }
14628 tail = XCDR (tail); 14628 tail = XCDR (tail);
14629 } 14629 }
14630 } 14630 }