aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-09-27 00:37:04 +0000
committerKarl Heuer1994-09-27 00:37:04 +0000
commite24c997dd3fad26308be1631ee6371cd33dacebd (patch)
tree2a848ba3bcbb5b75e356c4d58c328707ef59738a /src
parent6a5e54e26289cb4c9b7f2a3bbe44456a79be04a8 (diff)
downloademacs-e24c997dd3fad26308be1631ee6371cd33dacebd.tar.gz
emacs-e24c997dd3fad26308be1631ee6371cd33dacebd.zip
(redisplay, mark_window_display_accurate, try_window_id, display_text_line,
display_mode_element, decode_mode_spec, display_string): Use type test macros.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c68
1 files changed, 33 insertions, 35 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 09399a75ef6..b78da7692ad 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -638,7 +638,7 @@ redisplay ()
638 && GPT >= tlbufpos 638 && GPT >= tlbufpos
639 /* If selective display, can't optimize 639 /* If selective display, can't optimize
640 if the changes start at the beginning of the line. */ 640 if the changes start at the beginning of the line. */
641 && ((XTYPE (current_buffer->selective_display) == Lisp_Int 641 && ((INTEGERP (current_buffer->selective_display)
642 && XINT (current_buffer->selective_display) > 0 642 && XINT (current_buffer->selective_display) > 0
643 ? (beg_unchanged >= tlbufpos 643 ? (beg_unchanged >= tlbufpos
644 && GPT > tlbufpos) 644 && GPT > tlbufpos)
@@ -790,7 +790,7 @@ update:
790 { 790 {
791 FRAME_PTR f; 791 FRAME_PTR f;
792 792
793 if (XTYPE (XCONS (tail)->car) != Lisp_Frame) 793 if (!FRAMEP (XCONS (tail)->car))
794 continue; 794 continue;
795 795
796 f = XFRAME (XCONS (tail)->car); 796 f = XFRAME (XCONS (tail)->car);
@@ -928,7 +928,7 @@ mark_window_display_accurate (window, flag)
928 928
929 for (;!NILP (window); window = w->next) 929 for (;!NILP (window); window = w->next)
930 { 930 {
931 if (XTYPE (window) != Lisp_Window) abort (); 931 if (!WINDOWP (window)) abort ();
932 w = XWINDOW (window); 932 w = XWINDOW (window);
933 933
934 if (!NILP (w->buffer)) 934 if (!NILP (w->buffer))
@@ -1463,10 +1463,9 @@ try_window_id (window)
1463 register int i, tem; 1463 register int i, tem;
1464 int last_text_vpos = 0; 1464 int last_text_vpos = 0;
1465 int stop_vpos; 1465 int stop_vpos;
1466 int selective 1466 int selective = (INTEGERP (current_buffer->selective_display)
1467 = XTYPE (current_buffer->selective_display) == Lisp_Int 1467 ? XINT (current_buffer->selective_display)
1468 ? XINT (current_buffer->selective_display) 1468 : !NILP (current_buffer->selective_display) ? -1 : 0);
1469 : !NILP (current_buffer->selective_display) ? -1 : 0;
1470 1469
1471 struct position val, bp, ep, xp, pp; 1470 struct position val, bp, ep, xp, pp;
1472 int scroll_amount = 0; 1471 int scroll_amount = 0;
@@ -2033,10 +2032,9 @@ display_text_line (w, start, vpos, hpos, taboffset)
2033 = !NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active); 2032 = !NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active);
2034 int region_beg, region_end; 2033 int region_beg, region_end;
2035 2034
2036 int selective 2035 int selective = (INTEGERP (current_buffer->selective_display)
2037 = XTYPE (current_buffer->selective_display) == Lisp_Int 2036 ? XINT (current_buffer->selective_display)
2038 ? XINT (current_buffer->selective_display) 2037 : !NILP (current_buffer->selective_display) ? -1 : 0);
2039 : !NILP (current_buffer->selective_display) ? -1 : 0;
2040 register struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f); 2038 register struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f);
2041 register struct Lisp_Vector *dp = window_display_table (w); 2039 register struct Lisp_Vector *dp = window_display_table (w);
2042 2040
@@ -2044,20 +2042,20 @@ display_text_line (w, start, vpos, hpos, taboffset)
2044 /* Nonzero means display something where there are invisible lines. 2042 /* Nonzero means display something where there are invisible lines.
2045 The precise value is the number of glyphs to display. */ 2043 The precise value is the number of glyphs to display. */
2046 int selective_rlen 2044 int selective_rlen
2047 = (selective && dp && XTYPE (DISP_INVIS_VECTOR (dp)) == Lisp_Vector 2045 = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
2048 ? XVECTOR (DISP_INVIS_VECTOR (dp))->size 2046 ? XVECTOR (DISP_INVIS_VECTOR (dp))->size
2049 : selective && !NILP (current_buffer->selective_display_ellipses) 2047 : selective && !NILP (current_buffer->selective_display_ellipses)
2050 ? 3 : 0); 2048 ? 3 : 0);
2051 /* This is the sequence of Lisp objects to display 2049 /* This is the sequence of Lisp objects to display
2052 when there are invisible lines. */ 2050 when there are invisible lines. */
2053 Lisp_Object *invis_vector_contents 2051 Lisp_Object *invis_vector_contents
2054 = (dp && XTYPE (DISP_INVIS_VECTOR (dp)) == Lisp_Vector 2052 = (dp && VECTORP (DISP_INVIS_VECTOR (dp))
2055 ? XVECTOR (DISP_INVIS_VECTOR (dp))->contents 2053 ? XVECTOR (DISP_INVIS_VECTOR (dp))->contents
2056 : default_invis_vector); 2054 : default_invis_vector);
2057 2055
2058 GLYPH truncator = (dp == 0 || XTYPE (DISP_TRUNC_GLYPH (dp)) != Lisp_Int 2056 GLYPH truncator = (dp == 0 || !INTEGERP (DISP_TRUNC_GLYPH (dp))
2059 ? '$' : XINT (DISP_TRUNC_GLYPH (dp))); 2057 ? '$' : XINT (DISP_TRUNC_GLYPH (dp)));
2060 GLYPH continuer = (dp == 0 || XTYPE (DISP_CONTINUE_GLYPH (dp)) != Lisp_Int 2058 GLYPH continuer = (dp == 0 || !INTEGERP (DISP_CONTINUE_GLYPH (dp))
2061 ? '\\' : XINT (DISP_CONTINUE_GLYPH (dp))); 2059 ? '\\' : XINT (DISP_CONTINUE_GLYPH (dp)));
2062 2060
2063 /* The next buffer location at which the face should change, due 2061 /* The next buffer location at which the face should change, due
@@ -2231,7 +2229,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2231 } 2229 }
2232 c = *p++; 2230 c = *p++;
2233 if (c >= 040 && c < 0177 2231 if (c >= 040 && c < 0177
2234 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector)) 2232 && (dp == 0 || !VECTORP (DISP_CHAR_VECTOR (dp, c))))
2235 { 2233 {
2236 if (p1 >= leftmargin) 2234 if (p1 >= leftmargin)
2237 *p1 = MAKE_GLYPH (f, c, current_face); 2235 *p1 = MAKE_GLYPH (f, c, current_face);
@@ -2307,7 +2305,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2307#endif 2305#endif
2308 break; 2306 break;
2309 } 2307 }
2310 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector) 2308 else if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
2311 { 2309 {
2312 p1 = copy_part_of_rope (f, p1, leftmargin, 2310 p1 = copy_part_of_rope (f, p1, leftmargin,
2313 XVECTOR (DISP_CHAR_VECTOR (dp, c))->contents, 2311 XVECTOR (DISP_CHAR_VECTOR (dp, c))->contents,
@@ -2317,7 +2315,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2317 else if (c < 0200 && ctl_arrow) 2315 else if (c < 0200 && ctl_arrow)
2318 { 2316 {
2319 if (p1 >= leftmargin) 2317 if (p1 >= leftmargin)
2320 *p1 = fix_glyph (f, (dp && XTYPE (DISP_CTRL_GLYPH (dp)) == Lisp_Int 2318 *p1 = fix_glyph (f, (dp && INTEGERP (DISP_CTRL_GLYPH (dp))
2321 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'), 2319 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'),
2322 current_face); 2320 current_face);
2323 p1++; 2321 p1++;
@@ -2328,7 +2326,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2328 else 2326 else
2329 { 2327 {
2330 if (p1 >= leftmargin) 2328 if (p1 >= leftmargin)
2331 *p1 = fix_glyph (f, (dp && XTYPE (DISP_ESCAPE_GLYPH (dp)) == Lisp_Int 2329 *p1 = fix_glyph (f, (dp && INTEGERP (DISP_ESCAPE_GLYPH (dp))
2332 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'), 2330 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'),
2333 current_face); 2331 current_face);
2334 p1++; 2332 p1++;
@@ -2522,10 +2520,10 @@ display_text_line (w, start, vpos, hpos, taboffset)
2522 /* If the start of this line is the overlay arrow-position, 2520 /* If the start of this line is the overlay arrow-position,
2523 then put the arrow string into the display-line. */ 2521 then put the arrow string into the display-line. */
2524 2522
2525 if (XTYPE (Voverlay_arrow_position) == Lisp_Marker 2523 if (MARKERP (Voverlay_arrow_position)
2526 && current_buffer == XMARKER (Voverlay_arrow_position)->buffer 2524 && current_buffer == XMARKER (Voverlay_arrow_position)->buffer
2527 && start == marker_position (Voverlay_arrow_position) 2525 && start == marker_position (Voverlay_arrow_position)
2528 && XTYPE (Voverlay_arrow_string) == Lisp_String 2526 && STRINGP (Voverlay_arrow_string)
2529 && ! overlay_arrow_seen) 2527 && ! overlay_arrow_seen)
2530 { 2528 {
2531 unsigned char *p = XSTRING (Voverlay_arrow_string)->data; 2529 unsigned char *p = XSTRING (Voverlay_arrow_string)->data;
@@ -2782,7 +2780,7 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt)
2782 tem = Fsymbol_value (elt); 2780 tem = Fsymbol_value (elt);
2783 /* If value is a string, output that string literally: 2781 /* If value is a string, output that string literally:
2784 don't check for % within it. */ 2782 don't check for % within it. */
2785 if (XTYPE (tem) == Lisp_String) 2783 if (STRINGP (tem))
2786 { 2784 {
2787 if (frame_title_ptr) 2785 if (frame_title_ptr)
2788 hpos = store_frame_title (XSTRING (tem)->data, 2786 hpos = store_frame_title (XSTRING (tem)->data,
@@ -2812,11 +2810,11 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt)
2812 If first element is a symbol, process the cadr or caddr recursively 2810 If first element is a symbol, process the cadr or caddr recursively
2813 according to whether the symbol's value is non-nil or nil. */ 2811 according to whether the symbol's value is non-nil or nil. */
2814 car = XCONS (elt)->car; 2812 car = XCONS (elt)->car;
2815 if (XTYPE (car) == Lisp_Symbol) 2813 if (SYMBOLP (car))
2816 { 2814 {
2817 tem = Fboundp (car); 2815 tem = Fboundp (car);
2818 elt = XCONS (elt)->cdr; 2816 elt = XCONS (elt)->cdr;
2819 if (XTYPE (elt) != Lisp_Cons) 2817 if (!CONSP (elt))
2820 goto invalid; 2818 goto invalid;
2821 /* elt is now the cdr, and we know it is a cons cell. 2819 /* elt is now the cdr, and we know it is a cons cell.
2822 Use its car if CAR has a non-nil value. */ 2820 Use its car if CAR has a non-nil value. */
@@ -2832,12 +2830,12 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt)
2832 elt = XCONS (elt)->cdr; 2830 elt = XCONS (elt)->cdr;
2833 if (NILP (elt)) 2831 if (NILP (elt))
2834 break; 2832 break;
2835 else if (XTYPE (elt) != Lisp_Cons) 2833 else if (!CONSP (elt))
2836 goto invalid; 2834 goto invalid;
2837 elt = XCONS (elt)->car; 2835 elt = XCONS (elt)->car;
2838 goto tail_recurse; 2836 goto tail_recurse;
2839 } 2837 }
2840 else if (XTYPE (car) == Lisp_Int) 2838 else if (INTEGERP (car))
2841 { 2839 {
2842 register int lim = XINT (car); 2840 register int lim = XINT (car);
2843 elt = XCONS (elt)->cdr; 2841 elt = XCONS (elt)->cdr;
@@ -2862,11 +2860,11 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt)
2862 } 2860 }
2863 goto tail_recurse; 2861 goto tail_recurse;
2864 } 2862 }
2865 else if (XTYPE (car) == Lisp_String || XTYPE (car) == Lisp_Cons) 2863 else if (STRINGP (car) || CONSP (car))
2866 { 2864 {
2867 register int limit = 50; 2865 register int limit = 50;
2868 /* LIMIT is to protect against circular lists. */ 2866 /* LIMIT is to protect against circular lists. */
2869 while (XTYPE (elt) == Lisp_Cons && --limit > 0 2867 while (CONSP (elt) && --limit > 0
2870 && hpos < maxendcol) 2868 && hpos < maxendcol)
2871 { 2869 {
2872 hpos = display_mode_element (w, vpos, hpos, depth, 2870 hpos = display_mode_element (w, vpos, hpos, depth,
@@ -2936,7 +2934,7 @@ decode_mode_spec (w, c, maxwidth)
2936#if 0 2934#if 0
2937 if (NILP (obj)) 2935 if (NILP (obj))
2938 return "[none]"; 2936 return "[none]";
2939 else if (XTYPE (obj) == Lisp_String && XSTRING (obj)->size > maxwidth) 2937 else if (STRINGP (obj) && XSTRING (obj)->size > maxwidth)
2940 { 2938 {
2941 bcopy ("...", decode_mode_spec_buf, 3); 2939 bcopy ("...", decode_mode_spec_buf, 3);
2942 bcopy (XSTRING (obj)->data + XSTRING (obj)->size - maxwidth + 3, 2940 bcopy (XSTRING (obj)->data + XSTRING (obj)->size - maxwidth + 3,
@@ -3183,7 +3181,7 @@ decode_mode_spec (w, c, maxwidth)
3183 } 3181 }
3184 } 3182 }
3185 3183
3186 if (XTYPE (obj) == Lisp_String) 3184 if (STRINGP (obj))
3187 return (char *) XSTRING (obj)->data; 3185 return (char *) XSTRING (obj)->data;
3188 else 3186 else
3189 return ""; 3187 return "";
@@ -3369,7 +3367,7 @@ display_string (w, vpos, string, length, hpos, truncate,
3369 register struct Lisp_Vector *dp = 0; 3367 register struct Lisp_Vector *dp = 0;
3370 int i; 3368 int i;
3371 3369
3372 if (XTYPE (Vstandard_display_table) == Lisp_Vector 3370 if (VECTORP (Vstandard_display_table)
3373 && XVECTOR (Vstandard_display_table)->size == DISP_TABLE_SIZE) 3371 && XVECTOR (Vstandard_display_table)->size == DISP_TABLE_SIZE)
3374 dp = XVECTOR (Vstandard_display_table); 3372 dp = XVECTOR (Vstandard_display_table);
3375 3373
@@ -3420,7 +3418,7 @@ display_string (w, vpos, string, length, hpos, truncate,
3420 break; 3418 break;
3421 3419
3422 if (c >= 040 && c < 0177 3420 if (c >= 040 && c < 0177
3423 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector)) 3421 && (dp == 0 || !VECTORP (DISP_CHAR_VECTOR (dp, c))))
3424 { 3422 {
3425 if (p1 >= start) 3423 if (p1 >= start)
3426 *p1 = c; 3424 *p1 = c;
@@ -3436,7 +3434,7 @@ display_string (w, vpos, string, length, hpos, truncate,
3436 } 3434 }
3437 while ((p1 - start + hscroll - (hscroll > 0)) % tab_width); 3435 while ((p1 - start + hscroll - (hscroll > 0)) % tab_width);
3438 } 3436 }
3439 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector) 3437 else if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
3440 { 3438 {
3441 p1 = copy_part_of_rope (f, p1, start, 3439 p1 = copy_part_of_rope (f, p1, start,
3442 XVECTOR (DISP_CHAR_VECTOR (dp, c))->contents, 3440 XVECTOR (DISP_CHAR_VECTOR (dp, c))->contents,
@@ -3446,7 +3444,7 @@ display_string (w, vpos, string, length, hpos, truncate,
3446 else if (c < 0200 && ! NILP (buffer_defaults.ctl_arrow)) 3444 else if (c < 0200 && ! NILP (buffer_defaults.ctl_arrow))
3447 { 3445 {
3448 if (p1 >= start) 3446 if (p1 >= start)
3449 *p1 = fix_glyph (f, (dp && XTYPE (DISP_CTRL_GLYPH (dp)) == Lisp_Int 3447 *p1 = fix_glyph (f, (dp && INTEGERP (DISP_CTRL_GLYPH (dp))
3450 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'), 3448 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'),
3451 0); 3449 0);
3452 p1++; 3450 p1++;
@@ -3457,7 +3455,7 @@ display_string (w, vpos, string, length, hpos, truncate,
3457 else 3455 else
3458 { 3456 {
3459 if (p1 >= start) 3457 if (p1 >= start)
3460 *p1 = fix_glyph (f, (dp && XTYPE (DISP_ESCAPE_GLYPH (dp)) == Lisp_Int 3458 *p1 = fix_glyph (f, (dp && INTEGERP (DISP_ESCAPE_GLYPH (dp))
3461 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'), 3459 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'),
3462 0); 3460 0);
3463 p1++; 3461 p1++;