aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-09-27 02:55:09 +0000
committerKarl Heuer1994-09-27 02:55:09 +0000
commiteeaafd4f3ab6eeaab64f524696c88319be32a548 (patch)
treeaf495e1482a8806c73028cd564702847b44d18fb /src
parentb629dd47e02edba483c2140c5a77b67fed01fe04 (diff)
downloademacs-eeaafd4f3ab6eeaab64f524696c88319be32a548.tar.gz
emacs-eeaafd4f3ab6eeaab64f524696c88319be32a548.zip
(buffer_display_table, current_column, Fmove_to_column, compute_motion,
vmotion): Use type test macros.
Diffstat (limited to 'src')
-rw-r--r--src/indent.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/indent.c b/src/indent.c
index e34d1ec701d..7209c7ce0b3 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -56,10 +56,9 @@ buffer_display_table ()
56 Lisp_Object thisbuf; 56 Lisp_Object thisbuf;
57 57
58 thisbuf = current_buffer->display_table; 58 thisbuf = current_buffer->display_table;
59 if (XTYPE (thisbuf) == Lisp_Vector 59 if (VECTORP (thisbuf) && XVECTOR (thisbuf)->size == DISP_TABLE_SIZE)
60 && XVECTOR (thisbuf)->size == DISP_TABLE_SIZE)
61 return XVECTOR (thisbuf); 60 return XVECTOR (thisbuf);
62 if (XTYPE (Vstandard_display_table) == Lisp_Vector 61 if (VECTORP (Vstandard_display_table)
63 && XVECTOR (Vstandard_display_table)->size == DISP_TABLE_SIZE) 62 && XVECTOR (Vstandard_display_table)->size == DISP_TABLE_SIZE)
64 return XVECTOR (Vstandard_display_table); 63 return XVECTOR (Vstandard_display_table);
65 return 0; 64 return 0;
@@ -138,7 +137,7 @@ current_column ()
138 137
139 c = *--ptr; 138 c = *--ptr;
140 if (c >= 040 && c < 0177 139 if (c >= 040 && c < 0177
141 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector)) 140 && (dp == 0 || !VECTORP (DISP_CHAR_VECTOR (dp, c))))
142 { 141 {
143 col++; 142 col++;
144 } 143 }
@@ -155,7 +154,7 @@ current_column ()
155 col = 0; 154 col = 0;
156 tab_seen = 1; 155 tab_seen = 1;
157 } 156 }
158 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector) 157 else if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
159 col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; 158 col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
160 else 159 else
161 col += (ctl_arrow && c < 0200) ? 2 : 4; 160 col += (ctl_arrow && c < 0200) ? 2 : 4;
@@ -342,7 +341,7 @@ and if COLUMN is in the middle of a tab character, change it to spaces.")
342 col += tab_width; 341 col += tab_width;
343 col = col / tab_width * tab_width; 342 col = col / tab_width * tab_width;
344 } 343 }
345 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector) 344 else if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
346 col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; 345 col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
347 else if (ctl_arrow && (c < 040 || c == 0177)) 346 else if (ctl_arrow && (c < 040 || c == 0177))
348 col += 2; 347 col += 2;
@@ -450,12 +449,12 @@ compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, ta
450 register int ctl_arrow = !NILP (current_buffer->ctl_arrow); 449 register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
451 register struct Lisp_Vector *dp = window_display_table (win); 450 register struct Lisp_Vector *dp = window_display_table (win);
452 int selective 451 int selective
453 = (XTYPE (current_buffer->selective_display) == Lisp_Int 452 = (INTEGERP (current_buffer->selective_display)
454 ? XINT (current_buffer->selective_display) 453 ? XINT (current_buffer->selective_display)
455 : !NILP (current_buffer->selective_display) ? -1 : 0); 454 : !NILP (current_buffer->selective_display) ? -1 : 0);
456 int prev_vpos, prev_hpos = 0; 455 int prev_vpos, prev_hpos = 0;
457 int selective_rlen 456 int selective_rlen
458 = (selective && dp && XTYPE (DISP_INVIS_VECTOR (dp)) == Lisp_Vector 457 = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
459 ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); 458 ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
460#ifdef USE_TEXT_PROPERTIES 459#ifdef USE_TEXT_PROPERTIES
461 /* The next location where the `invisible' property changes */ 460 /* The next location where the `invisible' property changes */
@@ -507,7 +506,7 @@ compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, ta
507#endif 506#endif
508 c = FETCH_CHAR (pos); 507 c = FETCH_CHAR (pos);
509 if (c >= 040 && c < 0177 508 if (c >= 040 && c < 0177
510 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector)) 509 && (dp == 0 || !VECTORP (DISP_CHAR_VECTOR (dp, c))))
511 hpos++; 510 hpos++;
512 else if (c == '\t') 511 else if (c == '\t')
513 { 512 {
@@ -563,7 +562,7 @@ compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, ta
563 hpos = width; 562 hpos = width;
564 } 563 }
565 } 564 }
566 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector) 565 else if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
567 hpos += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; 566 hpos += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
568 else 567 else
569 hpos += (ctl_arrow && c < 0200) ? 2 : 4; 568 hpos += (ctl_arrow && c < 0200) ? 2 : 4;
@@ -752,9 +751,9 @@ vmotion (from, vtarget, width, hscroll, window)
752 register int first; 751 register int first;
753 int lmargin = hscroll > 0 ? 1 - hscroll : 0; 752 int lmargin = hscroll > 0 ? 1 - hscroll : 0;
754 int selective 753 int selective
755 = XTYPE (current_buffer->selective_display) == Lisp_Int 754 = (INTEGERP (current_buffer->selective_display)
756 ? XINT (current_buffer->selective_display) 755 ? XINT (current_buffer->selective_display)
757 : !NILP (current_buffer->selective_display) ? -1 : 0; 756 : !NILP (current_buffer->selective_display) ? -1 : 0);
758 /* The omission of the clause 757 /* The omission of the clause
759 && marker_position (XWINDOW (window)->start) == BEG 758 && marker_position (XWINDOW (window)->start) == BEG
760 here is deliberate; I think we want to measure from the prompt 759 here is deliberate; I think we want to measure from the prompt