diff options
| author | Ken Raeburn | 1999-09-12 07:05:34 +0000 |
|---|---|---|
| committer | Ken Raeburn | 1999-09-12 07:05:34 +0000 |
| commit | 8e713be64cb396e4fa30d8a393987b77d6cd99f6 (patch) | |
| tree | 8ca8beed123bcd05a9849f9a575fbc73ca17edad /src/xterm.c | |
| parent | 70949dac51f3e975477e6b1a38cc78625efc4a40 (diff) | |
| download | emacs-8e713be64cb396e4fa30d8a393987b77d6cd99f6.tar.gz emacs-8e713be64cb396e4fa30d8a393987b77d6cd99f6.zip | |
Use XCAR and XCDR instead of explicit member references.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/xterm.c b/src/xterm.c index 793e0098879..db2b3559a7c 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -7062,11 +7062,11 @@ x_window_to_scroll_bar (window_id) | |||
| 7062 | 7062 | ||
| 7063 | for (tail = Vframe_list; | 7063 | for (tail = Vframe_list; |
| 7064 | XGCTYPE (tail) == Lisp_Cons; | 7064 | XGCTYPE (tail) == Lisp_Cons; |
| 7065 | tail = XCONS (tail)->cdr) | 7065 | tail = XCDR (tail)) |
| 7066 | { | 7066 | { |
| 7067 | Lisp_Object frame, bar, condemned; | 7067 | Lisp_Object frame, bar, condemned; |
| 7068 | 7068 | ||
| 7069 | frame = XCONS (tail)->car; | 7069 | frame = XCAR (tail); |
| 7070 | /* All elements of Vframe_list should be frames. */ | 7070 | /* All elements of Vframe_list should be frames. */ |
| 7071 | if (! GC_FRAMEP (frame)) | 7071 | if (! GC_FRAMEP (frame)) |
| 7072 | abort (); | 7072 | abort (); |
| @@ -9061,7 +9061,7 @@ XTread_socket (sd, bufp, numchars, expected) | |||
| 9061 | numchars--; | 9061 | numchars--; |
| 9062 | } | 9062 | } |
| 9063 | else if (! NILP (Vframe_list) | 9063 | else if (! NILP (Vframe_list) |
| 9064 | && ! NILP (XCONS (Vframe_list)->cdr)) | 9064 | && ! NILP (XCDR (Vframe_list))) |
| 9065 | /* Force a redisplay sooner or later | 9065 | /* Force a redisplay sooner or later |
| 9066 | to update the frame titles | 9066 | to update the frame titles |
| 9067 | in case this is the second frame. */ | 9067 | in case this is the second frame. */ |
| @@ -11728,17 +11728,17 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 11728 | /* We can return any single font matching PATTERN. */ | 11728 | /* We can return any single font matching PATTERN. */ |
| 11729 | try_XLoadQueryFont = 1; | 11729 | try_XLoadQueryFont = 1; |
| 11730 | 11730 | ||
| 11731 | for (; CONSP (patterns); patterns = XCONS (patterns)->cdr) | 11731 | for (; CONSP (patterns); patterns = XCDR (patterns)) |
| 11732 | { | 11732 | { |
| 11733 | int num_fonts; | 11733 | int num_fonts; |
| 11734 | char **names; | 11734 | char **names; |
| 11735 | 11735 | ||
| 11736 | pattern = XCONS (patterns)->car; | 11736 | pattern = XCAR (patterns); |
| 11737 | /* See if we cached the result for this particular query. | 11737 | /* See if we cached the result for this particular query. |
| 11738 | The cache is an alist of the form: | 11738 | The cache is an alist of the form: |
| 11739 | (((PATTERN . MAXNAMES) (FONTNAME . WIDTH) ...) ...) | 11739 | (((PATTERN . MAXNAMES) (FONTNAME . WIDTH) ...) ...) |
| 11740 | */ | 11740 | */ |
| 11741 | if (f && (tem = XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr, | 11741 | if (f && (tem = XCDR (FRAME_X_DISPLAY_INFO (f)->name_list_element), |
| 11742 | key = Fcons (pattern, make_number (maxnames)), | 11742 | key = Fcons (pattern, make_number (maxnames)), |
| 11743 | !NILP (list = Fassoc (key, tem)))) | 11743 | !NILP (list = Fassoc (key, tem)))) |
| 11744 | { | 11744 | { |
| @@ -11864,30 +11864,30 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 11864 | 11864 | ||
| 11865 | /* Now store the result in the cache. */ | 11865 | /* Now store the result in the cache. */ |
| 11866 | if (f != NULL) | 11866 | if (f != NULL) |
| 11867 | XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr | 11867 | XCDR (FRAME_X_DISPLAY_INFO (f)->name_list_element) |
| 11868 | = Fcons (Fcons (key, list), | 11868 | = Fcons (Fcons (key, list), |
| 11869 | XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr); | 11869 | XCDR (FRAME_X_DISPLAY_INFO (f)->name_list_element)); |
| 11870 | 11870 | ||
| 11871 | label_cached: | 11871 | label_cached: |
| 11872 | if (NILP (list)) continue; /* Try the remaining alternatives. */ | 11872 | if (NILP (list)) continue; /* Try the remaining alternatives. */ |
| 11873 | 11873 | ||
| 11874 | newlist = second_best = Qnil; | 11874 | newlist = second_best = Qnil; |
| 11875 | /* Make a list of the fonts that have the right width. */ | 11875 | /* Make a list of the fonts that have the right width. */ |
| 11876 | for (; CONSP (list); list = XCONS (list)->cdr) | 11876 | for (; CONSP (list); list = XCDR (list)) |
| 11877 | { | 11877 | { |
| 11878 | int found_size; | 11878 | int found_size; |
| 11879 | 11879 | ||
| 11880 | tem = XCONS (list)->car; | 11880 | tem = XCAR (list); |
| 11881 | 11881 | ||
| 11882 | if (!CONSP (tem) || NILP (XCONS (tem)->car)) | 11882 | if (!CONSP (tem) || NILP (XCAR (tem))) |
| 11883 | continue; | 11883 | continue; |
| 11884 | if (!size) | 11884 | if (!size) |
| 11885 | { | 11885 | { |
| 11886 | newlist = Fcons (XCONS (tem)->car, newlist); | 11886 | newlist = Fcons (XCAR (tem), newlist); |
| 11887 | continue; | 11887 | continue; |
| 11888 | } | 11888 | } |
| 11889 | 11889 | ||
| 11890 | if (!INTEGERP (XCONS (tem)->cdr)) | 11890 | if (!INTEGERP (XCDR (tem))) |
| 11891 | { | 11891 | { |
| 11892 | /* Since we have not yet known the size of this font, we | 11892 | /* Since we have not yet known the size of this font, we |
| 11893 | must try slow function call XLoadQueryFont. */ | 11893 | must try slow function call XLoadQueryFont. */ |
| @@ -11896,7 +11896,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 11896 | BLOCK_INPUT; | 11896 | BLOCK_INPUT; |
| 11897 | count = x_catch_errors (dpy); | 11897 | count = x_catch_errors (dpy); |
| 11898 | thisinfo = XLoadQueryFont (dpy, | 11898 | thisinfo = XLoadQueryFont (dpy, |
| 11899 | XSTRING (XCONS (tem)->car)->data); | 11899 | XSTRING (XCAR (tem))->data); |
| 11900 | if (x_had_errors_p (dpy)) | 11900 | if (x_had_errors_p (dpy)) |
| 11901 | { | 11901 | { |
| 11902 | /* This error is perhaps due to insufficient memory on X | 11902 | /* This error is perhaps due to insufficient memory on X |
| @@ -11909,7 +11909,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 11909 | 11909 | ||
| 11910 | if (thisinfo) | 11910 | if (thisinfo) |
| 11911 | { | 11911 | { |
| 11912 | XCONS (tem)->cdr | 11912 | XCDR (tem) |
| 11913 | = (thisinfo->min_bounds.width == 0 | 11913 | = (thisinfo->min_bounds.width == 0 |
| 11914 | ? make_number (0) | 11914 | ? make_number (0) |
| 11915 | : make_number (thisinfo->max_bounds.width)); | 11915 | : make_number (thisinfo->max_bounds.width)); |
| @@ -11919,26 +11919,26 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 11919 | /* For unknown reason, the previous call of XListFont had | 11919 | /* For unknown reason, the previous call of XListFont had |
| 11920 | returned a font which can't be opened. Record the size | 11920 | returned a font which can't be opened. Record the size |
| 11921 | as 0 not to try to open it again. */ | 11921 | as 0 not to try to open it again. */ |
| 11922 | XCONS (tem)->cdr = make_number (0); | 11922 | XCDR (tem) = make_number (0); |
| 11923 | } | 11923 | } |
| 11924 | 11924 | ||
| 11925 | found_size = XINT (XCONS (tem)->cdr); | 11925 | found_size = XINT (XCDR (tem)); |
| 11926 | if (found_size == size) | 11926 | if (found_size == size) |
| 11927 | newlist = Fcons (XCONS (tem)->car, newlist); | 11927 | newlist = Fcons (XCAR (tem), newlist); |
| 11928 | else if (found_size > 0) | 11928 | else if (found_size > 0) |
| 11929 | { | 11929 | { |
| 11930 | if (NILP (second_best)) | 11930 | if (NILP (second_best)) |
| 11931 | second_best = tem; | 11931 | second_best = tem; |
| 11932 | else if (found_size < size) | 11932 | else if (found_size < size) |
| 11933 | { | 11933 | { |
| 11934 | if (XINT (XCONS (second_best)->cdr) > size | 11934 | if (XINT (XCDR (second_best)) > size |
| 11935 | || XINT (XCONS (second_best)->cdr) < found_size) | 11935 | || XINT (XCDR (second_best)) < found_size) |
| 11936 | second_best = tem; | 11936 | second_best = tem; |
| 11937 | } | 11937 | } |
| 11938 | else | 11938 | else |
| 11939 | { | 11939 | { |
| 11940 | if (XINT (XCONS (second_best)->cdr) > size | 11940 | if (XINT (XCDR (second_best)) > size |
| 11941 | && XINT (XCONS (second_best)->cdr) > found_size) | 11941 | && XINT (XCDR (second_best)) > found_size) |
| 11942 | second_best = tem; | 11942 | second_best = tem; |
| 11943 | } | 11943 | } |
| 11944 | } | 11944 | } |
| @@ -11947,7 +11947,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 11947 | break; | 11947 | break; |
| 11948 | else if (!NILP (second_best)) | 11948 | else if (!NILP (second_best)) |
| 11949 | { | 11949 | { |
| 11950 | newlist = Fcons (XCONS (second_best)->car, Qnil); | 11950 | newlist = Fcons (XCAR (second_best), Qnil); |
| 11951 | break; | 11951 | break; |
| 11952 | } | 11952 | } |
| 11953 | } | 11953 | } |
| @@ -12071,12 +12071,12 @@ x_load_font (f, fontname, size) | |||
| 12071 | int i; | 12071 | int i; |
| 12072 | 12072 | ||
| 12073 | for (i = 0; i < dpyinfo->n_fonts; i++) | 12073 | for (i = 0; i < dpyinfo->n_fonts; i++) |
| 12074 | for (tail = font_names; CONSP (tail); tail = XCONS (tail)->cdr) | 12074 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) |
| 12075 | if (dpyinfo->font_table[i].name | 12075 | if (dpyinfo->font_table[i].name |
| 12076 | && (!strcmp (dpyinfo->font_table[i].name, | 12076 | && (!strcmp (dpyinfo->font_table[i].name, |
| 12077 | XSTRING (XCONS (tail)->car)->data) | 12077 | XSTRING (XCAR (tail))->data) |
| 12078 | || !strcmp (dpyinfo->font_table[i].full_name, | 12078 | || !strcmp (dpyinfo->font_table[i].full_name, |
| 12079 | XSTRING (XCONS (tail)->car)->data))) | 12079 | XSTRING (XCAR (tail))->data))) |
| 12080 | return (dpyinfo->font_table + i); | 12080 | return (dpyinfo->font_table + i); |
| 12081 | } | 12081 | } |
| 12082 | 12082 | ||
| @@ -12094,7 +12094,7 @@ x_load_font (f, fontname, size) | |||
| 12094 | a bug of not finding a font even if the font surely exists and | 12094 | a bug of not finding a font even if the font surely exists and |
| 12095 | is loadable by XLoadQueryFont. */ | 12095 | is loadable by XLoadQueryFont. */ |
| 12096 | if (size > 0 && !NILP (font_names)) | 12096 | if (size > 0 && !NILP (font_names)) |
| 12097 | fontname = (char *) XSTRING (XCONS (font_names)->car)->data; | 12097 | fontname = (char *) XSTRING (XCAR (font_names))->data; |
| 12098 | 12098 | ||
| 12099 | BLOCK_INPUT; | 12099 | BLOCK_INPUT; |
| 12100 | count = x_catch_errors (FRAME_X_DISPLAY (f)); | 12100 | count = x_catch_errors (FRAME_X_DISPLAY (f)); |
| @@ -12190,19 +12190,19 @@ x_load_font (f, fontname, size) | |||
| 12190 | Lisp_Object lispy_name = build_string (fontname); | 12190 | Lisp_Object lispy_name = build_string (fontname); |
| 12191 | Lisp_Object lispy_full_name = build_string (fontp->full_name); | 12191 | Lisp_Object lispy_full_name = build_string (fontp->full_name); |
| 12192 | 12192 | ||
| 12193 | XCONS (dpyinfo->name_list_element)->cdr | 12193 | XCDR (dpyinfo->name_list_element) |
| 12194 | = Fcons (Fcons (Fcons (lispy_name, make_number (256)), | 12194 | = Fcons (Fcons (Fcons (lispy_name, make_number (256)), |
| 12195 | Fcons (Fcons (lispy_full_name, | 12195 | Fcons (Fcons (lispy_full_name, |
| 12196 | make_number (fontp->size)), | 12196 | make_number (fontp->size)), |
| 12197 | Qnil)), | 12197 | Qnil)), |
| 12198 | XCONS (dpyinfo->name_list_element)->cdr); | 12198 | XCDR (dpyinfo->name_list_element)); |
| 12199 | if (full_name) | 12199 | if (full_name) |
| 12200 | XCONS (dpyinfo->name_list_element)->cdr | 12200 | XCDR (dpyinfo->name_list_element) |
| 12201 | = Fcons (Fcons (Fcons (lispy_full_name, make_number (256)), | 12201 | = Fcons (Fcons (Fcons (lispy_full_name, make_number (256)), |
| 12202 | Fcons (Fcons (lispy_full_name, | 12202 | Fcons (Fcons (lispy_full_name, |
| 12203 | make_number (fontp->size)), | 12203 | make_number (fontp->size)), |
| 12204 | Qnil)), | 12204 | Qnil)), |
| 12205 | XCONS (dpyinfo->name_list_element)->cdr); | 12205 | XCDR (dpyinfo->name_list_element)); |
| 12206 | } | 12206 | } |
| 12207 | 12207 | ||
| 12208 | /* The slot `encoding' specifies how to map a character | 12208 | /* The slot `encoding' specifies how to map a character |
| @@ -12288,12 +12288,12 @@ x_find_ccl_program (fontp) | |||
| 12288 | { | 12288 | { |
| 12289 | Lisp_Object list, elt; | 12289 | Lisp_Object list, elt; |
| 12290 | 12290 | ||
| 12291 | for (list = Vfont_ccl_encoder_alist; CONSP (list); list = XCONS (list)->cdr) | 12291 | for (list = Vfont_ccl_encoder_alist; CONSP (list); list = XCDR (list)) |
| 12292 | { | 12292 | { |
| 12293 | elt = XCONS (list)->car; | 12293 | elt = XCAR (list); |
| 12294 | if (CONSP (elt) | 12294 | if (CONSP (elt) |
| 12295 | && STRINGP (XCONS (elt)->car) | 12295 | && STRINGP (XCAR (elt)) |
| 12296 | && (fast_c_string_match_ignore_case (XCONS (elt)->car, fontp->name) | 12296 | && (fast_c_string_match_ignore_case (XCAR (elt), fontp->name) |
| 12297 | >= 0)) | 12297 | >= 0)) |
| 12298 | break; | 12298 | break; |
| 12299 | } | 12299 | } |
| @@ -12302,7 +12302,7 @@ x_find_ccl_program (fontp) | |||
| 12302 | struct ccl_program *ccl | 12302 | struct ccl_program *ccl |
| 12303 | = (struct ccl_program *) xmalloc (sizeof (struct ccl_program)); | 12303 | = (struct ccl_program *) xmalloc (sizeof (struct ccl_program)); |
| 12304 | 12304 | ||
| 12305 | if (setup_ccl_program (ccl, XCONS (elt)->cdr) < 0) | 12305 | if (setup_ccl_program (ccl, XCDR (elt)) < 0) |
| 12306 | xfree (ccl); | 12306 | xfree (ccl); |
| 12307 | else | 12307 | else |
| 12308 | fontp->font_encoder = ccl; | 12308 | fontp->font_encoder = ccl; |
| @@ -12487,8 +12487,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 12487 | Lisp_Object tail; | 12487 | Lisp_Object tail; |
| 12488 | 12488 | ||
| 12489 | for (share = x_display_list, tail = x_display_name_list; share; | 12489 | for (share = x_display_list, tail = x_display_name_list; share; |
| 12490 | share = share->next, tail = XCONS (tail)->cdr) | 12490 | share = share->next, tail = XCDR (tail)) |
| 12491 | if (same_x_server (XSTRING (XCONS (XCONS (tail)->car)->car)->data, | 12491 | if (same_x_server (XSTRING (XCAR (XCAR (tail)))->data, |
| 12492 | XSTRING (display_name)->data)) | 12492 | XSTRING (display_name)->data)) |
| 12493 | break; | 12493 | break; |
| 12494 | if (share) | 12494 | if (share) |
| @@ -12524,7 +12524,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 12524 | /* Put it on x_display_name_list as well, to keep them parallel. */ | 12524 | /* Put it on x_display_name_list as well, to keep them parallel. */ |
| 12525 | x_display_name_list = Fcons (Fcons (display_name, Qnil), | 12525 | x_display_name_list = Fcons (Fcons (display_name, Qnil), |
| 12526 | x_display_name_list); | 12526 | x_display_name_list); |
| 12527 | dpyinfo->name_list_element = XCONS (x_display_name_list)->car; | 12527 | dpyinfo->name_list_element = XCAR (x_display_name_list); |
| 12528 | 12528 | ||
| 12529 | dpyinfo->display = dpy; | 12529 | dpyinfo->display = dpy; |
| 12530 | 12530 | ||
| @@ -12743,22 +12743,22 @@ x_delete_display (dpyinfo) | |||
| 12743 | /* Discard this display from x_display_name_list and x_display_list. | 12743 | /* Discard this display from x_display_name_list and x_display_list. |
| 12744 | We can't use Fdelq because that can quit. */ | 12744 | We can't use Fdelq because that can quit. */ |
| 12745 | if (! NILP (x_display_name_list) | 12745 | if (! NILP (x_display_name_list) |
| 12746 | && EQ (XCONS (x_display_name_list)->car, dpyinfo->name_list_element)) | 12746 | && EQ (XCAR (x_display_name_list), dpyinfo->name_list_element)) |
| 12747 | x_display_name_list = XCONS (x_display_name_list)->cdr; | 12747 | x_display_name_list = XCDR (x_display_name_list); |
| 12748 | else | 12748 | else |
| 12749 | { | 12749 | { |
| 12750 | Lisp_Object tail; | 12750 | Lisp_Object tail; |
| 12751 | 12751 | ||
| 12752 | tail = x_display_name_list; | 12752 | tail = x_display_name_list; |
| 12753 | while (CONSP (tail) && CONSP (XCONS (tail)->cdr)) | 12753 | while (CONSP (tail) && CONSP (XCDR (tail))) |
| 12754 | { | 12754 | { |
| 12755 | if (EQ (XCONS (XCONS (tail)->cdr)->car, | 12755 | if (EQ (XCAR (XCDR (tail)), |
| 12756 | dpyinfo->name_list_element)) | 12756 | dpyinfo->name_list_element)) |
| 12757 | { | 12757 | { |
| 12758 | XCONS (tail)->cdr = XCONS (XCONS (tail)->cdr)->cdr; | 12758 | XCDR (tail) = XCDR (XCDR (tail)); |
| 12759 | break; | 12759 | break; |
| 12760 | } | 12760 | } |
| 12761 | tail = XCONS (tail)->cdr; | 12761 | tail = XCDR (tail); |
| 12762 | } | 12762 | } |
| 12763 | } | 12763 | } |
| 12764 | 12764 | ||