diff options
| -rw-r--r-- | src/ChangeLog | 23 | ||||
| -rw-r--r-- | src/dispextern.h | 17 | ||||
| -rw-r--r-- | src/w32fns.c | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 105 | ||||
| -rw-r--r-- | src/xfns.c | 6 |
5 files changed, 89 insertions, 68 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d2ae0262171..21bdc81d797 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2015-01-08 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (next_element_from_c_string): Use Lisp integer zero as | ||
| 4 | the object. | ||
| 5 | (set_cursor_from_row, try_cursor_movement, dump_glyph) | ||
| 6 | (insert_left_trunc_glyphs, append_space_for_newline) | ||
| 7 | (extend_face_to_end_of_line, highlight_trailing_whitespace) | ||
| 8 | (find_row_edges, ROW_GLYPH_NEWLINE_P, Fmove_point_visually) | ||
| 9 | (Fbidi_resolved_levels, produce_special_glyphs) | ||
| 10 | (rows_from_pos_range, mouse_face_from_buffer_pos) | ||
| 11 | (note_mouse_highlight): Use nil as the object for glyphs inserted | ||
| 12 | by the display engine, and test with NILP instead of INTEGERP. | ||
| 13 | (Bug#19535) | ||
| 14 | |||
| 15 | * w32fns.c (Fx_show_tip): Use NILP to test for glyphs inserted by | ||
| 16 | the display engine. | ||
| 17 | |||
| 18 | * xfns.c (Fx_show_tip): Use NILP to test for glyphs inserted by | ||
| 19 | the display engine. | ||
| 20 | |||
| 21 | * dispextern.h (struct glyph, struct it): Update comments for the | ||
| 22 | OBJECT members. | ||
| 23 | |||
| 1 | 2015-01-08 Paul Eggert <eggert@cs.ucla.edu> | 24 | 2015-01-08 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 25 | ||
| 3 | Port new Lisp symbol init to x86 --with-wide-int | 26 | Port new Lisp symbol init to x86 --with-wide-int |
diff --git a/src/dispextern.h b/src/dispextern.h index d717473f8c2..1a9aef103bd 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -389,10 +389,9 @@ struct glyph | |||
| 389 | 389 | ||
| 390 | /* Lisp object source of this glyph. Currently either a buffer or a | 390 | /* Lisp object source of this glyph. Currently either a buffer or a |
| 391 | string, if the glyph was produced from characters which came from | 391 | string, if the glyph was produced from characters which came from |
| 392 | a buffer or a string; or Lisp integer zero (a.k.a. "null object") | 392 | a buffer or a string; or nil if the glyph was inserted by |
| 393 | if the glyph was inserted by redisplay for its own purposes, such | 393 | redisplay for its own purposes, such as padding, truncation, or |
| 394 | as padding or truncation/continuation glyphs, or the | 394 | continuation glyphs, or the overlay-arrow glyphs on TTYs. */ |
| 395 | overlay-arrow glyphs on TTYs. */ | ||
| 396 | Lisp_Object object; | 395 | Lisp_Object object; |
| 397 | 396 | ||
| 398 | /* Width in pixels. */ | 397 | /* Width in pixels. */ |
| @@ -2525,11 +2524,11 @@ struct it | |||
| 2525 | Object is normally the buffer which is being rendered, but it can | 2524 | Object is normally the buffer which is being rendered, but it can |
| 2526 | also be a Lisp string in case the current display element comes | 2525 | also be a Lisp string in case the current display element comes |
| 2527 | from an overlay string or from a display string (before- or | 2526 | from an overlay string or from a display string (before- or |
| 2528 | after-string). It may also be nil when a C string is being | 2527 | after-string). It may also be a zero-valued Lisp integer when a |
| 2529 | rendered, e.g., during mode-line or header-line update. It can | 2528 | C string is being rendered, e.g., during mode-line or header-line |
| 2530 | also be a cons cell of the form `(space ...)', when we produce a | 2529 | update. It can also be a cons cell of the form `(space ...)', |
| 2531 | stretch glyph from a `display' specification. Finally, it can be | 2530 | when we produce a stretch glyph from a `display' specification. |
| 2532 | a zero-valued Lisp integer, but only temporarily, when we are | 2531 | Finally, it can be nil, but only temporarily, when we are |
| 2533 | producing special glyphs for display purposes, like truncation | 2532 | producing special glyphs for display purposes, like truncation |
| 2534 | and continuation glyphs, or blanks that extend each line to the | 2533 | and continuation glyphs, or blanks that extend each line to the |
| 2535 | edge of the window on a TTY. | 2534 | edge of the window on a TTY. |
diff --git a/src/w32fns.c b/src/w32fns.c index 38571d3ec21..ced3d87dd66 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -6128,7 +6128,7 @@ Text larger than the specified size is clipped. */) | |||
| 6128 | place the cursor there. Don't include the width of | 6128 | place the cursor there. Don't include the width of |
| 6129 | this glyph. */ | 6129 | this glyph. */ |
| 6130 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; | 6130 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; |
| 6131 | if (INTEGERP (last->object)) | 6131 | if (NILP (last->object)) |
| 6132 | row_width -= last->pixel_width; | 6132 | row_width -= last->pixel_width; |
| 6133 | } | 6133 | } |
| 6134 | else | 6134 | else |
| @@ -6138,7 +6138,7 @@ Text larger than the specified size is clipped. */) | |||
| 6138 | Don't count that glyph. */ | 6138 | Don't count that glyph. */ |
| 6139 | struct glyph *g = row->glyphs[TEXT_AREA]; | 6139 | struct glyph *g = row->glyphs[TEXT_AREA]; |
| 6140 | 6140 | ||
| 6141 | if (g->type == STRETCH_GLYPH && INTEGERP (g->object)) | 6141 | if (g->type == STRETCH_GLYPH && NILP (g->object)) |
| 6142 | { | 6142 | { |
| 6143 | row_width -= g->pixel_width; | 6143 | row_width -= g->pixel_width; |
| 6144 | seen_reversed_p = 1; | 6144 | seen_reversed_p = 1; |
| @@ -6187,7 +6187,7 @@ Text larger than the specified size is clipped. */) | |||
| 6187 | if (row->used[TEXT_AREA] && !row->reversed_p) | 6187 | if (row->used[TEXT_AREA] && !row->reversed_p) |
| 6188 | { | 6188 | { |
| 6189 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; | 6189 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; |
| 6190 | if (INTEGERP (last->object)) | 6190 | if (NILP (last->object)) |
| 6191 | row_width -= last->pixel_width; | 6191 | row_width -= last->pixel_width; |
| 6192 | } | 6192 | } |
| 6193 | 6193 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 58a4f43be81..36babfa74db 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -7933,7 +7933,7 @@ next_element_from_c_string (struct it *it) | |||
| 7933 | eassert (!it->bidi_p || it->s == it->bidi_it.string.s); | 7933 | eassert (!it->bidi_p || it->s == it->bidi_it.string.s); |
| 7934 | it->what = IT_CHARACTER; | 7934 | it->what = IT_CHARACTER; |
| 7935 | BYTEPOS (it->position) = CHARPOS (it->position) = 0; | 7935 | BYTEPOS (it->position) = CHARPOS (it->position) = 0; |
| 7936 | it->object = Qnil; | 7936 | it->object = make_number (0); |
| 7937 | 7937 | ||
| 7938 | /* With bidi reordering, the character to display might not be the | 7938 | /* With bidi reordering, the character to display might not be the |
| 7939 | character at IT_CHARPOS. BIDI_IT.FIRST_ELT non-zero means that | 7939 | character at IT_CHARPOS. BIDI_IT.FIRST_ELT non-zero means that |
| @@ -14280,14 +14280,14 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 14280 | if (!row->reversed_p) | 14280 | if (!row->reversed_p) |
| 14281 | { | 14281 | { |
| 14282 | while (glyph < end | 14282 | while (glyph < end |
| 14283 | && INTEGERP (glyph->object) | 14283 | && NILP (glyph->object) |
| 14284 | && glyph->charpos < 0) | 14284 | && glyph->charpos < 0) |
| 14285 | { | 14285 | { |
| 14286 | x += glyph->pixel_width; | 14286 | x += glyph->pixel_width; |
| 14287 | ++glyph; | 14287 | ++glyph; |
| 14288 | } | 14288 | } |
| 14289 | while (end > glyph | 14289 | while (end > glyph |
| 14290 | && INTEGERP ((end - 1)->object) | 14290 | && NILP ((end - 1)->object) |
| 14291 | /* CHARPOS is zero for blanks and stretch glyphs | 14291 | /* CHARPOS is zero for blanks and stretch glyphs |
| 14292 | inserted by extend_face_to_end_of_line. */ | 14292 | inserted by extend_face_to_end_of_line. */ |
| 14293 | && (end - 1)->charpos <= 0) | 14293 | && (end - 1)->charpos <= 0) |
| @@ -14305,20 +14305,20 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 14305 | glyph += row->used[TEXT_AREA] - 1; | 14305 | glyph += row->used[TEXT_AREA] - 1; |
| 14306 | 14306 | ||
| 14307 | while (glyph > end + 1 | 14307 | while (glyph > end + 1 |
| 14308 | && INTEGERP (glyph->object) | 14308 | && NILP (glyph->object) |
| 14309 | && glyph->charpos < 0) | 14309 | && glyph->charpos < 0) |
| 14310 | { | 14310 | { |
| 14311 | --glyph; | 14311 | --glyph; |
| 14312 | x -= glyph->pixel_width; | 14312 | x -= glyph->pixel_width; |
| 14313 | } | 14313 | } |
| 14314 | if (INTEGERP (glyph->object) && glyph->charpos < 0) | 14314 | if (NILP (glyph->object) && glyph->charpos < 0) |
| 14315 | --glyph; | 14315 | --glyph; |
| 14316 | /* By default, in reversed rows we put the cursor on the | 14316 | /* By default, in reversed rows we put the cursor on the |
| 14317 | rightmost (first in the reading order) glyph. */ | 14317 | rightmost (first in the reading order) glyph. */ |
| 14318 | for (g = end + 1; g < glyph; g++) | 14318 | for (g = end + 1; g < glyph; g++) |
| 14319 | x += g->pixel_width; | 14319 | x += g->pixel_width; |
| 14320 | while (end < glyph | 14320 | while (end < glyph |
| 14321 | && INTEGERP ((end + 1)->object) | 14321 | && NILP ((end + 1)->object) |
| 14322 | && (end + 1)->charpos <= 0) | 14322 | && (end + 1)->charpos <= 0) |
| 14323 | ++end; | 14323 | ++end; |
| 14324 | glyph_before = glyph + 1; | 14324 | glyph_before = glyph + 1; |
| @@ -14349,7 +14349,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 14349 | while (/* not marched to end of glyph row */ | 14349 | while (/* not marched to end of glyph row */ |
| 14350 | glyph < end | 14350 | glyph < end |
| 14351 | /* glyph was not inserted by redisplay for internal purposes */ | 14351 | /* glyph was not inserted by redisplay for internal purposes */ |
| 14352 | && !INTEGERP (glyph->object)) | 14352 | && !NILP (glyph->object)) |
| 14353 | { | 14353 | { |
| 14354 | if (BUFFERP (glyph->object)) | 14354 | if (BUFFERP (glyph->object)) |
| 14355 | { | 14355 | { |
| @@ -14437,7 +14437,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 14437 | ++glyph; | 14437 | ++glyph; |
| 14438 | } | 14438 | } |
| 14439 | else if (glyph > end) /* row is reversed */ | 14439 | else if (glyph > end) /* row is reversed */ |
| 14440 | while (!INTEGERP (glyph->object)) | 14440 | while (!NILP (glyph->object)) |
| 14441 | { | 14441 | { |
| 14442 | if (BUFFERP (glyph->object)) | 14442 | if (BUFFERP (glyph->object)) |
| 14443 | { | 14443 | { |
| @@ -14514,16 +14514,16 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 14514 | && BUFFERP (glyph->object) && glyph->charpos == pt_old) | 14514 | && BUFFERP (glyph->object) && glyph->charpos == pt_old) |
| 14515 | && !(bpos_max <= pt_old && pt_old <= bpos_covered)) | 14515 | && !(bpos_max <= pt_old && pt_old <= bpos_covered)) |
| 14516 | { | 14516 | { |
| 14517 | /* An empty line has a single glyph whose OBJECT is zero and | 14517 | /* An empty line has a single glyph whose OBJECT is nil and |
| 14518 | whose CHARPOS is the position of a newline on that line. | 14518 | whose CHARPOS is the position of a newline on that line. |
| 14519 | Note that on a TTY, there are more glyphs after that, which | 14519 | Note that on a TTY, there are more glyphs after that, which |
| 14520 | were produced by extend_face_to_end_of_line, but their | 14520 | were produced by extend_face_to_end_of_line, but their |
| 14521 | CHARPOS is zero or negative. */ | 14521 | CHARPOS is zero or negative. */ |
| 14522 | int empty_line_p = | 14522 | int empty_line_p = |
| 14523 | (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end) | 14523 | (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end) |
| 14524 | && INTEGERP (glyph->object) && glyph->charpos > 0 | 14524 | && NILP (glyph->object) && glyph->charpos > 0 |
| 14525 | /* On a TTY, continued and truncated rows also have a glyph at | 14525 | /* On a TTY, continued and truncated rows also have a glyph at |
| 14526 | their end whose OBJECT is zero and whose CHARPOS is | 14526 | their end whose OBJECT is nil and whose CHARPOS is |
| 14527 | positive (the continuation and truncation glyphs), but such | 14527 | positive (the continuation and truncation glyphs), but such |
| 14528 | rows are obviously not "empty". */ | 14528 | rows are obviously not "empty". */ |
| 14529 | && !(row->continued_p || row->truncated_on_right_p); | 14529 | && !(row->continued_p || row->truncated_on_right_p); |
| @@ -14800,7 +14800,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 14800 | && string_from_text_prop) | 14800 | && string_from_text_prop) |
| 14801 | /* this candidate is from newline and its | 14801 | /* this candidate is from newline and its |
| 14802 | position is not an exact match */ | 14802 | position is not an exact match */ |
| 14803 | || (INTEGERP (glyph->object) | 14803 | || (NILP (glyph->object) |
| 14804 | && glyph->charpos != pt_old))))) | 14804 | && glyph->charpos != pt_old))))) |
| 14805 | return 0; | 14805 | return 0; |
| 14806 | /* If this candidate gives an exact match, use that. */ | 14806 | /* If this candidate gives an exact match, use that. */ |
| @@ -14809,7 +14809,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 14809 | terminating newline of a line, and point is on that | 14809 | terminating newline of a line, and point is on that |
| 14810 | newline, it wins because it's an exact match. */ | 14810 | newline, it wins because it's an exact match. */ |
| 14811 | || (!row->continued_p | 14811 | || (!row->continued_p |
| 14812 | && INTEGERP (glyph->object) | 14812 | && NILP (glyph->object) |
| 14813 | && glyph->charpos == 0 | 14813 | && glyph->charpos == 0 |
| 14814 | && pt_old == MATRIX_ROW_END_CHARPOS (row) - 1)) | 14814 | && pt_old == MATRIX_ROW_END_CHARPOS (row) - 1)) |
| 14815 | /* Otherwise, keep the candidate that comes from a row | 14815 | /* Otherwise, keep the candidate that comes from a row |
| @@ -15652,7 +15652,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 15652 | 15652 | ||
| 15653 | exact_match_p = | 15653 | exact_match_p = |
| 15654 | (BUFFERP (g->object) && g->charpos == PT) | 15654 | (BUFFERP (g->object) && g->charpos == PT) |
| 15655 | || (INTEGERP (g->object) | 15655 | || (NILP (g->object) |
| 15656 | && (g->charpos == PT | 15656 | && (g->charpos == PT |
| 15657 | || (g->charpos == 0 && endpos - 1 == PT))); | 15657 | || (g->charpos == 0 && endpos - 1 == PT))); |
| 15658 | } | 15658 | } |
| @@ -18506,7 +18506,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 18506 | ? 'B' | 18506 | ? 'B' |
| 18507 | : (STRINGP (glyph->object) | 18507 | : (STRINGP (glyph->object) |
| 18508 | ? 'S' | 18508 | ? 'S' |
| 18509 | : (INTEGERP (glyph->object) | 18509 | : (NILP (glyph->object) |
| 18510 | ? '0' | 18510 | ? '0' |
| 18511 | : '-'))), | 18511 | : '-'))), |
| 18512 | glyph->pixel_width, | 18512 | glyph->pixel_width, |
| @@ -18529,7 +18529,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 18529 | ? 'B' | 18529 | ? 'B' |
| 18530 | : (STRINGP (glyph->object) | 18530 | : (STRINGP (glyph->object) |
| 18531 | ? 'S' | 18531 | ? 'S' |
| 18532 | : (INTEGERP (glyph->object) | 18532 | : (NILP (glyph->object) |
| 18533 | ? '0' | 18533 | ? '0' |
| 18534 | : '-'))), | 18534 | : '-'))), |
| 18535 | glyph->pixel_width, | 18535 | glyph->pixel_width, |
| @@ -18550,7 +18550,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 18550 | ? 'B' | 18550 | ? 'B' |
| 18551 | : (STRINGP (glyph->object) | 18551 | : (STRINGP (glyph->object) |
| 18552 | ? 'S' | 18552 | ? 'S' |
| 18553 | : (INTEGERP (glyph->object) | 18553 | : (NILP (glyph->object) |
| 18554 | ? '0' | 18554 | ? '0' |
| 18555 | : '-'))), | 18555 | : '-'))), |
| 18556 | glyph->pixel_width, | 18556 | glyph->pixel_width, |
| @@ -18571,7 +18571,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 18571 | ? 'B' | 18571 | ? 'B' |
| 18572 | : (STRINGP (glyph->object) | 18572 | : (STRINGP (glyph->object) |
| 18573 | ? 'S' | 18573 | ? 'S' |
| 18574 | : (INTEGERP (glyph->object) | 18574 | : (NILP (glyph->object) |
| 18575 | ? '0' | 18575 | ? '0' |
| 18576 | : '-'))), | 18576 | : '-'))), |
| 18577 | glyph->pixel_width, | 18577 | glyph->pixel_width, |
| @@ -18671,7 +18671,7 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs) | |||
| 18671 | struct glyph *glyph = row->glyphs[area] + i; | 18671 | struct glyph *glyph = row->glyphs[area] + i; |
| 18672 | if (i == row->used[area] - 1 | 18672 | if (i == row->used[area] - 1 |
| 18673 | && area == TEXT_AREA | 18673 | && area == TEXT_AREA |
| 18674 | && INTEGERP (glyph->object) | 18674 | && NILP (glyph->object) |
| 18675 | && glyph->type == CHAR_GLYPH | 18675 | && glyph->type == CHAR_GLYPH |
| 18676 | && glyph->u.ch == ' ') | 18676 | && glyph->u.ch == ' ') |
| 18677 | { | 18677 | { |
| @@ -18901,7 +18901,7 @@ insert_left_trunc_glyphs (struct it *it) | |||
| 18901 | truncate_it.area = TEXT_AREA; | 18901 | truncate_it.area = TEXT_AREA; |
| 18902 | truncate_it.glyph_row->used[TEXT_AREA] = 0; | 18902 | truncate_it.glyph_row->used[TEXT_AREA] = 0; |
| 18903 | CHARPOS (truncate_it.position) = BYTEPOS (truncate_it.position) = -1; | 18903 | CHARPOS (truncate_it.position) = BYTEPOS (truncate_it.position) = -1; |
| 18904 | truncate_it.object = make_number (0); | 18904 | truncate_it.object = Qnil; |
| 18905 | produce_special_glyphs (&truncate_it, IT_TRUNCATION); | 18905 | produce_special_glyphs (&truncate_it, IT_TRUNCATION); |
| 18906 | 18906 | ||
| 18907 | /* Overwrite glyphs from IT with truncation glyphs. */ | 18907 | /* Overwrite glyphs from IT with truncation glyphs. */ |
| @@ -19184,7 +19184,7 @@ append_space_for_newline (struct it *it, int default_face_p) | |||
| 19184 | 19184 | ||
| 19185 | it->what = IT_CHARACTER; | 19185 | it->what = IT_CHARACTER; |
| 19186 | memset (&it->position, 0, sizeof it->position); | 19186 | memset (&it->position, 0, sizeof it->position); |
| 19187 | it->object = make_number (0); | 19187 | it->object = Qnil; |
| 19188 | it->c = it->char_to_display = ' '; | 19188 | it->c = it->char_to_display = ' '; |
| 19189 | it->len = 1; | 19189 | it->len = 1; |
| 19190 | 19190 | ||
| @@ -19376,7 +19376,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 19376 | else | 19376 | else |
| 19377 | it->face_id = face->id; | 19377 | it->face_id = face->id; |
| 19378 | it->start_of_box_run_p = 0; | 19378 | it->start_of_box_run_p = 0; |
| 19379 | append_stretch_glyph (it, make_number (0), stretch_width, | 19379 | append_stretch_glyph (it, Qnil, stretch_width, |
| 19380 | it->ascent + it->descent, stretch_ascent); | 19380 | it->ascent + it->descent, stretch_ascent); |
| 19381 | it->position = saved_pos; | 19381 | it->position = saved_pos; |
| 19382 | it->avoid_cursor_p = saved_avoid_cursor; | 19382 | it->avoid_cursor_p = saved_avoid_cursor; |
| @@ -19406,7 +19406,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 19406 | 19406 | ||
| 19407 | it->what = IT_CHARACTER; | 19407 | it->what = IT_CHARACTER; |
| 19408 | memset (&it->position, 0, sizeof it->position); | 19408 | memset (&it->position, 0, sizeof it->position); |
| 19409 | it->object = make_number (0); | 19409 | it->object = Qnil; |
| 19410 | it->c = it->char_to_display = ' '; | 19410 | it->c = it->char_to_display = ' '; |
| 19411 | it->len = 1; | 19411 | it->len = 1; |
| 19412 | 19412 | ||
| @@ -19535,14 +19535,14 @@ highlight_trailing_whitespace (struct frame *f, struct glyph_row *row) | |||
| 19535 | { | 19535 | { |
| 19536 | while (glyph >= start | 19536 | while (glyph >= start |
| 19537 | && glyph->type == CHAR_GLYPH | 19537 | && glyph->type == CHAR_GLYPH |
| 19538 | && INTEGERP (glyph->object)) | 19538 | && NILP (glyph->object)) |
| 19539 | --glyph; | 19539 | --glyph; |
| 19540 | } | 19540 | } |
| 19541 | else | 19541 | else |
| 19542 | { | 19542 | { |
| 19543 | while (glyph <= start | 19543 | while (glyph <= start |
| 19544 | && glyph->type == CHAR_GLYPH | 19544 | && glyph->type == CHAR_GLYPH |
| 19545 | && INTEGERP (glyph->object)) | 19545 | && NILP (glyph->object)) |
| 19546 | ++glyph; | 19546 | ++glyph; |
| 19547 | } | 19547 | } |
| 19548 | 19548 | ||
| @@ -19905,10 +19905,9 @@ find_row_edges (struct it *it, struct glyph_row *row, | |||
| 19905 | { | 19905 | { |
| 19906 | start = r1->glyphs[TEXT_AREA]; | 19906 | start = r1->glyphs[TEXT_AREA]; |
| 19907 | end = start + r1->used[TEXT_AREA]; | 19907 | end = start + r1->used[TEXT_AREA]; |
| 19908 | /* Glyphs inserted by redisplay have an integer (zero) | 19908 | /* Glyphs inserted by redisplay have nil as their object. */ |
| 19909 | as their object. */ | ||
| 19910 | while (end > start | 19909 | while (end > start |
| 19911 | && INTEGERP ((end - 1)->object) | 19910 | && NILP ((end - 1)->object) |
| 19912 | && (end - 1)->charpos <= 0) | 19911 | && (end - 1)->charpos <= 0) |
| 19913 | --end; | 19912 | --end; |
| 19914 | if (end > start) | 19913 | if (end > start) |
| @@ -19929,7 +19928,7 @@ find_row_edges (struct it *it, struct glyph_row *row, | |||
| 19929 | end = r1->glyphs[TEXT_AREA] - 1; | 19928 | end = r1->glyphs[TEXT_AREA] - 1; |
| 19930 | start = end + r1->used[TEXT_AREA]; | 19929 | start = end + r1->used[TEXT_AREA]; |
| 19931 | while (end < start | 19930 | while (end < start |
| 19932 | && INTEGERP ((end + 1)->object) | 19931 | && NILP ((end + 1)->object) |
| 19933 | && (end + 1)->charpos <= 0) | 19932 | && (end + 1)->charpos <= 0) |
| 19934 | ++end; | 19933 | ++end; |
| 19935 | if (end < start) | 19934 | if (end < start) |
| @@ -21082,7 +21081,7 @@ Value is the new character position of point. */) | |||
| 21082 | 21081 | ||
| 21083 | #define ROW_GLYPH_NEWLINE_P(ROW,GLYPH) \ | 21082 | #define ROW_GLYPH_NEWLINE_P(ROW,GLYPH) \ |
| 21084 | (!(ROW)->continued_p \ | 21083 | (!(ROW)->continued_p \ |
| 21085 | && INTEGERP ((GLYPH)->object) \ | 21084 | && NILP ((GLYPH)->object) \ |
| 21086 | && (GLYPH)->type == CHAR_GLYPH \ | 21085 | && (GLYPH)->type == CHAR_GLYPH \ |
| 21087 | && (GLYPH)->u.ch == ' ' \ | 21086 | && (GLYPH)->u.ch == ' ' \ |
| 21088 | && (GLYPH)->charpos >= 0 \ | 21087 | && (GLYPH)->charpos >= 0 \ |
| @@ -21124,7 +21123,7 @@ Value is the new character position of point. */) | |||
| 21124 | w->cursor.vpos = -1; | 21123 | w->cursor.vpos = -1; |
| 21125 | return make_number (PT); | 21124 | return make_number (PT); |
| 21126 | } | 21125 | } |
| 21127 | else if (!INTEGERP (g->object) && !EQ (g->object, gpt->object)) | 21126 | else if (!NILP (g->object) && !EQ (g->object, gpt->object)) |
| 21128 | { | 21127 | { |
| 21129 | ptrdiff_t new_pos; | 21128 | ptrdiff_t new_pos; |
| 21130 | 21129 | ||
| @@ -21161,7 +21160,7 @@ Value is the new character position of point. */) | |||
| 21161 | return make_number (PT); | 21160 | return make_number (PT); |
| 21162 | } | 21161 | } |
| 21163 | } | 21162 | } |
| 21164 | if (g == e || INTEGERP (g->object)) | 21163 | if (g == e || NILP (g->object)) |
| 21165 | { | 21164 | { |
| 21166 | if (row->truncated_on_left_p || row->truncated_on_right_p) | 21165 | if (row->truncated_on_left_p || row->truncated_on_right_p) |
| 21167 | goto simulate_display; | 21166 | goto simulate_display; |
| @@ -21194,7 +21193,7 @@ Value is the new character position of point. */) | |||
| 21194 | EOB also has one glyph, but its charpos is -1. */ | 21193 | EOB also has one glyph, but its charpos is -1. */ |
| 21195 | || (row->ends_at_zv_p | 21194 | || (row->ends_at_zv_p |
| 21196 | && !row->reversed_p | 21195 | && !row->reversed_p |
| 21197 | && INTEGERP (g->object) | 21196 | && NILP (g->object) |
| 21198 | && g->type == CHAR_GLYPH | 21197 | && g->type == CHAR_GLYPH |
| 21199 | && g->u.ch == ' ')) | 21198 | && g->u.ch == ' ')) |
| 21200 | { | 21199 | { |
| @@ -21232,7 +21231,7 @@ Value is the new character position of point. */) | |||
| 21232 | || g->type == STRETCH_GLYPH | 21231 | || g->type == STRETCH_GLYPH |
| 21233 | || (row->ends_at_zv_p | 21232 | || (row->ends_at_zv_p |
| 21234 | && row->reversed_p | 21233 | && row->reversed_p |
| 21235 | && INTEGERP (g->object) | 21234 | && NILP (g->object) |
| 21236 | && g->type == CHAR_GLYPH | 21235 | && g->type == CHAR_GLYPH |
| 21237 | && g->u.ch == ' ')) | 21236 | && g->u.ch == ' ')) |
| 21238 | { | 21237 | { |
| @@ -21596,13 +21595,13 @@ Emacs UBA implementation, in particular with the test suite. */) | |||
| 21596 | /* Skip over glyphs at the start of the row that was | 21595 | /* Skip over glyphs at the start of the row that was |
| 21597 | generated by redisplay for its own needs. */ | 21596 | generated by redisplay for its own needs. */ |
| 21598 | while (g < e | 21597 | while (g < e |
| 21599 | && INTEGERP (g->object) | 21598 | && NILP (g->object) |
| 21600 | && g->charpos < 0) | 21599 | && g->charpos < 0) |
| 21601 | g++; | 21600 | g++; |
| 21602 | g1 = g; | 21601 | g1 = g; |
| 21603 | 21602 | ||
| 21604 | /* Count the "interesting" glyphs in this row. */ | 21603 | /* Count the "interesting" glyphs in this row. */ |
| 21605 | for (nglyphs = 0; g < e && !INTEGERP (g->object); g++) | 21604 | for (nglyphs = 0; g < e && !NILP (g->object); g++) |
| 21606 | nglyphs++; | 21605 | nglyphs++; |
| 21607 | 21606 | ||
| 21608 | /* Create and fill the array. */ | 21607 | /* Create and fill the array. */ |
| @@ -21615,11 +21614,11 @@ Emacs UBA implementation, in particular with the test suite. */) | |||
| 21615 | g = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1; | 21614 | g = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1; |
| 21616 | e = row->glyphs[TEXT_AREA] - 1; | 21615 | e = row->glyphs[TEXT_AREA] - 1; |
| 21617 | while (g > e | 21616 | while (g > e |
| 21618 | && INTEGERP (g->object) | 21617 | && NILP (g->object) |
| 21619 | && g->charpos < 0) | 21618 | && g->charpos < 0) |
| 21620 | g--; | 21619 | g--; |
| 21621 | g1 = g; | 21620 | g1 = g; |
| 21622 | for (nglyphs = 0; g > e && !INTEGERP (g->object); g--) | 21621 | for (nglyphs = 0; g > e && !NILP (g->object); g--) |
| 21623 | nglyphs++; | 21622 | nglyphs++; |
| 21624 | levels = make_uninit_vector (nglyphs); | 21623 | levels = make_uninit_vector (nglyphs); |
| 21625 | for (i = 0; g1 > g; i++, g1--) | 21624 | for (i = 0; g1 > g; i++, g1--) |
| @@ -25944,7 +25943,7 @@ produce_special_glyphs (struct it *it, enum display_element_type what) | |||
| 25944 | GLYPH glyph; | 25943 | GLYPH glyph; |
| 25945 | 25944 | ||
| 25946 | temp_it = *it; | 25945 | temp_it = *it; |
| 25947 | temp_it.object = make_number (0); | 25946 | temp_it.object = Qnil; |
| 25948 | memset (&temp_it.current, 0, sizeof temp_it.current); | 25947 | memset (&temp_it.current, 0, sizeof temp_it.current); |
| 25949 | 25948 | ||
| 25950 | if (what == IT_CONTINUATION) | 25949 | if (what == IT_CONTINUATION) |
| @@ -26007,7 +26006,7 @@ produce_special_glyphs (struct it *it, enum display_element_type what) | |||
| 26007 | (((temp_it.ascent + temp_it.descent) | 26006 | (((temp_it.ascent + temp_it.descent) |
| 26008 | * FONT_BASE (font)) / FONT_HEIGHT (font)); | 26007 | * FONT_BASE (font)) / FONT_HEIGHT (font)); |
| 26009 | 26008 | ||
| 26010 | append_stretch_glyph (&temp_it, make_number (0), stretch_width, | 26009 | append_stretch_glyph (&temp_it, Qnil, stretch_width, |
| 26011 | temp_it.ascent + temp_it.descent, | 26010 | temp_it.ascent + temp_it.descent, |
| 26012 | stretch_ascent); | 26011 | stretch_ascent); |
| 26013 | } | 26012 | } |
| @@ -28182,7 +28181,7 @@ rows_from_pos_range (struct window *w, | |||
| 28182 | 28181 | ||
| 28183 | while (g < e) | 28182 | while (g < e) |
| 28184 | { | 28183 | { |
| 28185 | if (((BUFFERP (g->object) || INTEGERP (g->object)) | 28184 | if (((BUFFERP (g->object) || NILP (g->object)) |
| 28186 | && start_charpos <= g->charpos && g->charpos < end_charpos) | 28185 | && start_charpos <= g->charpos && g->charpos < end_charpos) |
| 28187 | /* A glyph that comes from DISP_STRING is by | 28186 | /* A glyph that comes from DISP_STRING is by |
| 28188 | definition to be highlighted. */ | 28187 | definition to be highlighted. */ |
| @@ -28237,7 +28236,7 @@ rows_from_pos_range (struct window *w, | |||
| 28237 | 28236 | ||
| 28238 | while (g < e) | 28237 | while (g < e) |
| 28239 | { | 28238 | { |
| 28240 | if (((BUFFERP (g->object) || INTEGERP (g->object)) | 28239 | if (((BUFFERP (g->object) || NILP (g->object)) |
| 28241 | && ((start_charpos <= g->charpos && g->charpos < end_charpos) | 28240 | && ((start_charpos <= g->charpos && g->charpos < end_charpos) |
| 28242 | /* If the buffer position of the first glyph in | 28241 | /* If the buffer position of the first glyph in |
| 28243 | the row is equal to END_CHARPOS, it means | 28242 | the row is equal to END_CHARPOS, it means |
| @@ -28319,7 +28318,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28319 | { | 28318 | { |
| 28320 | struct glyph *beg = prev->glyphs[TEXT_AREA]; | 28319 | struct glyph *beg = prev->glyphs[TEXT_AREA]; |
| 28321 | glyph = beg + prev->used[TEXT_AREA]; | 28320 | glyph = beg + prev->used[TEXT_AREA]; |
| 28322 | while (--glyph >= beg && INTEGERP (glyph->object)); | 28321 | while (--glyph >= beg && NILP (glyph->object)); |
| 28323 | if (glyph < beg | 28322 | if (glyph < beg |
| 28324 | || !(EQ (glyph->object, before_string) | 28323 | || !(EQ (glyph->object, before_string) |
| 28325 | || EQ (glyph->object, disp_string))) | 28324 | || EQ (glyph->object, disp_string))) |
| @@ -28383,7 +28382,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28383 | /* Skip truncation glyphs at the start of the glyph row. */ | 28382 | /* Skip truncation glyphs at the start of the glyph row. */ |
| 28384 | if (MATRIX_ROW_DISPLAYS_TEXT_P (r1)) | 28383 | if (MATRIX_ROW_DISPLAYS_TEXT_P (r1)) |
| 28385 | for (; glyph < end | 28384 | for (; glyph < end |
| 28386 | && INTEGERP (glyph->object) | 28385 | && NILP (glyph->object) |
| 28387 | && glyph->charpos < 0; | 28386 | && glyph->charpos < 0; |
| 28388 | ++glyph) | 28387 | ++glyph) |
| 28389 | x += glyph->pixel_width; | 28388 | x += glyph->pixel_width; |
| @@ -28392,7 +28391,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28392 | or DISP_STRING, and the first glyph from buffer whose | 28391 | or DISP_STRING, and the first glyph from buffer whose |
| 28393 | position is between START_CHARPOS and END_CHARPOS. */ | 28392 | position is between START_CHARPOS and END_CHARPOS. */ |
| 28394 | for (; glyph < end | 28393 | for (; glyph < end |
| 28395 | && !INTEGERP (glyph->object) | 28394 | && !NILP (glyph->object) |
| 28396 | && !EQ (glyph->object, disp_string) | 28395 | && !EQ (glyph->object, disp_string) |
| 28397 | && !(BUFFERP (glyph->object) | 28396 | && !(BUFFERP (glyph->object) |
| 28398 | && (glyph->charpos >= start_charpos | 28397 | && (glyph->charpos >= start_charpos |
| @@ -28434,7 +28433,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28434 | /* Skip truncation glyphs at the start of the glyph row. */ | 28433 | /* Skip truncation glyphs at the start of the glyph row. */ |
| 28435 | if (MATRIX_ROW_DISPLAYS_TEXT_P (r1)) | 28434 | if (MATRIX_ROW_DISPLAYS_TEXT_P (r1)) |
| 28436 | for (; glyph > end | 28435 | for (; glyph > end |
| 28437 | && INTEGERP (glyph->object) | 28436 | && NILP (glyph->object) |
| 28438 | && glyph->charpos < 0; | 28437 | && glyph->charpos < 0; |
| 28439 | --glyph) | 28438 | --glyph) |
| 28440 | ; | 28439 | ; |
| @@ -28443,7 +28442,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28443 | or DISP_STRING, and the first glyph from buffer whose | 28442 | or DISP_STRING, and the first glyph from buffer whose |
| 28444 | position is between START_CHARPOS and END_CHARPOS. */ | 28443 | position is between START_CHARPOS and END_CHARPOS. */ |
| 28445 | for (; glyph > end | 28444 | for (; glyph > end |
| 28446 | && !INTEGERP (glyph->object) | 28445 | && !NILP (glyph->object) |
| 28447 | && !EQ (glyph->object, disp_string) | 28446 | && !EQ (glyph->object, disp_string) |
| 28448 | && !(BUFFERP (glyph->object) | 28447 | && !(BUFFERP (glyph->object) |
| 28449 | && (glyph->charpos >= start_charpos | 28448 | && (glyph->charpos >= start_charpos |
| @@ -28500,7 +28499,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28500 | row, and also blanks and stretch glyphs inserted by | 28499 | row, and also blanks and stretch glyphs inserted by |
| 28501 | extend_face_to_end_of_line. */ | 28500 | extend_face_to_end_of_line. */ |
| 28502 | while (end > glyph | 28501 | while (end > glyph |
| 28503 | && INTEGERP ((end - 1)->object)) | 28502 | && NILP ((end - 1)->object)) |
| 28504 | --end; | 28503 | --end; |
| 28505 | /* Scan the rest of the glyph row from the end, looking for the | 28504 | /* Scan the rest of the glyph row from the end, looking for the |
| 28506 | first glyph that comes from BEFORE_STRING, AFTER_STRING, or | 28505 | first glyph that comes from BEFORE_STRING, AFTER_STRING, or |
| @@ -28508,7 +28507,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28508 | and END_CHARPOS */ | 28507 | and END_CHARPOS */ |
| 28509 | for (--end; | 28508 | for (--end; |
| 28510 | end > glyph | 28509 | end > glyph |
| 28511 | && !INTEGERP (end->object) | 28510 | && !NILP (end->object) |
| 28512 | && !EQ (end->object, disp_string) | 28511 | && !EQ (end->object, disp_string) |
| 28513 | && !(BUFFERP (end->object) | 28512 | && !(BUFFERP (end->object) |
| 28514 | && (end->charpos >= start_charpos | 28513 | && (end->charpos >= start_charpos |
| @@ -28546,7 +28545,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28546 | x = r2->x; | 28545 | x = r2->x; |
| 28547 | end++; | 28546 | end++; |
| 28548 | while (end < glyph | 28547 | while (end < glyph |
| 28549 | && INTEGERP (end->object)) | 28548 | && NILP (end->object)) |
| 28550 | { | 28549 | { |
| 28551 | x += end->pixel_width; | 28550 | x += end->pixel_width; |
| 28552 | ++end; | 28551 | ++end; |
| @@ -28557,7 +28556,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 28557 | and END_CHARPOS */ | 28556 | and END_CHARPOS */ |
| 28558 | for ( ; | 28557 | for ( ; |
| 28559 | end < glyph | 28558 | end < glyph |
| 28560 | && !INTEGERP (end->object) | 28559 | && !NILP (end->object) |
| 28561 | && !EQ (end->object, disp_string) | 28560 | && !EQ (end->object, disp_string) |
| 28562 | && !(BUFFERP (end->object) | 28561 | && !(BUFFERP (end->object) |
| 28563 | && (end->charpos >= start_charpos | 28562 | && (end->charpos >= start_charpos |
| @@ -29489,12 +29488,12 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 29489 | if (glyph == NULL | 29488 | if (glyph == NULL |
| 29490 | || area != TEXT_AREA | 29489 | || area != TEXT_AREA |
| 29491 | || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix, vpos)) | 29490 | || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix, vpos)) |
| 29492 | /* Glyph's OBJECT is an integer for glyphs inserted by the | 29491 | /* Glyph's OBJECT is nil for glyphs inserted by the |
| 29493 | display engine for its internal purposes, like truncation | 29492 | display engine for its internal purposes, like truncation |
| 29494 | and continuation glyphs and blanks beyond the end of | 29493 | and continuation glyphs and blanks beyond the end of |
| 29495 | line's text on text terminals. If we are over such a | 29494 | line's text on text terminals. If we are over such a |
| 29496 | glyph, we are not over any text. */ | 29495 | glyph, we are not over any text. */ |
| 29497 | || INTEGERP (glyph->object) | 29496 | || NILP (glyph->object) |
| 29498 | /* R2L rows have a stretch glyph at their front, which | 29497 | /* R2L rows have a stretch glyph at their front, which |
| 29499 | stands for no text, whereas L2R rows have no glyphs at | 29498 | stands for no text, whereas L2R rows have no glyphs at |
| 29500 | all beyond the end of text. Treat such stretch glyphs | 29499 | all beyond the end of text. Treat such stretch glyphs |
diff --git a/src/xfns.c b/src/xfns.c index d4f96c61b07..4a417526dcd 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5494,7 +5494,7 @@ Text larger than the specified size is clipped. */) | |||
| 5494 | if (!row->reversed_p) | 5494 | if (!row->reversed_p) |
| 5495 | { | 5495 | { |
| 5496 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; | 5496 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; |
| 5497 | if (INTEGERP (last->object)) | 5497 | if (NILP (last->object)) |
| 5498 | row_width -= last->pixel_width; | 5498 | row_width -= last->pixel_width; |
| 5499 | } | 5499 | } |
| 5500 | else | 5500 | else |
| @@ -5504,7 +5504,7 @@ Text larger than the specified size is clipped. */) | |||
| 5504 | Don't count that glyph. */ | 5504 | Don't count that glyph. */ |
| 5505 | struct glyph *g = row->glyphs[TEXT_AREA]; | 5505 | struct glyph *g = row->glyphs[TEXT_AREA]; |
| 5506 | 5506 | ||
| 5507 | if (g->type == STRETCH_GLYPH && INTEGERP (g->object)) | 5507 | if (g->type == STRETCH_GLYPH && NILP (g->object)) |
| 5508 | { | 5508 | { |
| 5509 | row_width -= g->pixel_width; | 5509 | row_width -= g->pixel_width; |
| 5510 | seen_reversed_p = 1; | 5510 | seen_reversed_p = 1; |
| @@ -5548,7 +5548,7 @@ Text larger than the specified size is clipped. */) | |||
| 5548 | if (row->used[TEXT_AREA] && !row->reversed_p) | 5548 | if (row->used[TEXT_AREA] && !row->reversed_p) |
| 5549 | { | 5549 | { |
| 5550 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; | 5550 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; |
| 5551 | if (INTEGERP (last->object)) | 5551 | if (NILP (last->object)) |
| 5552 | row_width -= last->pixel_width; | 5552 | row_width -= last->pixel_width; |
| 5553 | } | 5553 | } |
| 5554 | 5554 | ||