diff options
| author | Richard M. Stallman | 1996-10-06 22:48:40 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-10-06 22:48:40 +0000 |
| commit | 0f9c0ff030a58227303ac74d20c79751ea0e43b7 (patch) | |
| tree | f029ed0591436a7c9b72f60b322b339963b96e37 /src | |
| parent | d3b064685692908505f16e2e382a531889b21859 (diff) | |
| download | emacs-0f9c0ff030a58227303ac74d20c79751ea0e43b7.tar.gz emacs-0f9c0ff030a58227303ac74d20c79751ea0e43b7.zip | |
(display_text_line): New arg ovstr_done. (Callers changed).
Ignore that many chars from start of overlay strings.
Return updated value in ovstring_chars_done field.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index f56a16a7a82..c150277ac3d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -987,7 +987,7 @@ redisplay_internal (preserve_echo_area) | |||
| 987 | overlay_arrow_seen = 0; | 987 | overlay_arrow_seen = 0; |
| 988 | zv_strings_seen = 0; | 988 | zv_strings_seen = 0; |
| 989 | display_text_line (w, tlbufpos, this_line_vpos, this_line_start_hpos, | 989 | display_text_line (w, tlbufpos, this_line_vpos, this_line_start_hpos, |
| 990 | pos_tab_offset (w, tlbufpos)); | 990 | pos_tab_offset (w, tlbufpos), 0); |
| 991 | /* If line contains point, is not continued, | 991 | /* If line contains point, is not continued, |
| 992 | and ends at same distance from eob as before, we win */ | 992 | and ends at same distance from eob as before, we win */ |
| 993 | if (cursor_vpos >= 0 && this_line_bufpos | 993 | if (cursor_vpos >= 0 && this_line_bufpos |
| @@ -1930,10 +1930,12 @@ try_window (window, pos) | |||
| 1930 | overlay_arrow_seen = 0; | 1930 | overlay_arrow_seen = 0; |
| 1931 | zv_strings_seen = 0; | 1931 | zv_strings_seen = 0; |
| 1932 | val.hpos = XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0; | 1932 | val.hpos = XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0; |
| 1933 | val.ovstring_chars_done = 0; | ||
| 1933 | 1934 | ||
| 1934 | while (--height >= 0) | 1935 | while (--height >= 0) |
| 1935 | { | 1936 | { |
| 1936 | val = *display_text_line (w, pos, vpos, val.hpos, tab_offset); | 1937 | val = *display_text_line (w, pos, vpos, val.hpos, tab_offset, |
| 1938 | val.ovstring_chars_done); | ||
| 1937 | tab_offset += width; | 1939 | tab_offset += width; |
| 1938 | /* For the first line displayed, display_text_line | 1940 | /* For the first line displayed, display_text_line |
| 1939 | subtracts the prompt width from the tab offset. | 1941 | subtracts the prompt width from the tab offset. |
| @@ -2259,7 +2261,8 @@ try_window_id (window) | |||
| 2259 | old_tick = MODIFF; | 2261 | old_tick = MODIFF; |
| 2260 | while (vpos < stop_vpos) | 2262 | while (vpos < stop_vpos) |
| 2261 | { | 2263 | { |
| 2262 | val = *display_text_line (w, pos, top + vpos++, val.hpos, tab_offset); | 2264 | val = *display_text_line (w, pos, top + vpos++, val.hpos, tab_offset, |
| 2265 | val.ovstring_chars_done); | ||
| 2263 | /* If display_text_line ran a hook and changed some text, | 2266 | /* If display_text_line ran a hook and changed some text, |
| 2264 | redisplay all the way to bottom of buffer | 2267 | redisplay all the way to bottom of buffer |
| 2265 | So that we show the changes. */ | 2268 | So that we show the changes. */ |
| @@ -2315,7 +2318,8 @@ try_window_id (window) | |||
| 2315 | 2318 | ||
| 2316 | while (vpos < height) | 2319 | while (vpos < height) |
| 2317 | { | 2320 | { |
| 2318 | val = *display_text_line (w, pos, top + vpos++, val.hpos, tab_offset); | 2321 | val = *display_text_line (w, pos, top + vpos++, val.hpos, tab_offset, |
| 2322 | val.ovstring_chars_done); | ||
| 2319 | tab_offset += width; | 2323 | tab_offset += width; |
| 2320 | if (val.vpos) tab_offset = 0; | 2324 | if (val.vpos) tab_offset = 0; |
| 2321 | pos = val.bufpos; | 2325 | pos = val.bufpos; |
| @@ -2473,6 +2477,9 @@ fix_glyph (f, glyph, cface) | |||
| 2473 | 2477 | ||
| 2474 | TABOFFSET is an offset for ostensible hpos, used in tab stop calculations. | 2478 | TABOFFSET is an offset for ostensible hpos, used in tab stop calculations. |
| 2475 | 2479 | ||
| 2480 | OVSTR_DONE is the number of chars of overlay before/after strings | ||
| 2481 | at this position which have already been processed. | ||
| 2482 | |||
| 2476 | Display on position VPOS on the frame. It is origin 0, relative to | 2483 | Display on position VPOS on the frame. It is origin 0, relative to |
| 2477 | the top of the frame, not W. | 2484 | the top of the frame, not W. |
| 2478 | 2485 | ||
| @@ -2483,12 +2490,13 @@ fix_glyph (f, glyph, cface) | |||
| 2483 | struct position val_display_text_line; | 2490 | struct position val_display_text_line; |
| 2484 | 2491 | ||
| 2485 | static struct position * | 2492 | static struct position * |
| 2486 | display_text_line (w, start, vpos, hpos, taboffset) | 2493 | display_text_line (w, start, vpos, hpos, taboffset, ovstr_done) |
| 2487 | struct window *w; | 2494 | struct window *w; |
| 2488 | int start; | 2495 | int start; |
| 2489 | int vpos; | 2496 | int vpos; |
| 2490 | int hpos; | 2497 | int hpos; |
| 2491 | int taboffset; | 2498 | int taboffset; |
| 2499 | int ovstr_done; | ||
| 2492 | { | 2500 | { |
| 2493 | register int pos = start; | 2501 | register int pos = start; |
| 2494 | register int c; | 2502 | register int c; |
| @@ -2685,11 +2693,26 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 2685 | int ovlen; | 2693 | int ovlen; |
| 2686 | unsigned char *ovstr; | 2694 | unsigned char *ovstr; |
| 2687 | ovlen = overlay_strings (pos, w, &ovstr); | 2695 | ovlen = overlay_strings (pos, w, &ovstr); |
| 2688 | for (; ovlen; ovlen--, ovstr++) | 2696 | |
| 2697 | if (ovlen > 0) | ||
| 2689 | { | 2698 | { |
| 2690 | if (p1 >= leftmargin && p1 < endp) | 2699 | /* Skip the ones we did in a previous line. */ |
| 2691 | *p1 = MAKE_GLYPH (f, *ovstr, current_face); | 2700 | ovstr += ovstr_done; |
| 2692 | p1++; | 2701 | ovlen -= ovstr_done; |
| 2702 | |||
| 2703 | /* Start outputting. */ | ||
| 2704 | for (; ovlen; ovlen--, ovstr++) | ||
| 2705 | { | ||
| 2706 | if (p1 >= leftmargin && p1 < endp) | ||
| 2707 | *p1 = MAKE_GLYPH (f, *ovstr, current_face); | ||
| 2708 | p1++; | ||
| 2709 | ovstr_done++; | ||
| 2710 | } | ||
| 2711 | /* If we did all the overlay strings | ||
| 2712 | and we have room for text, clear ovstr_done | ||
| 2713 | just for neatness' sake. */ | ||
| 2714 | if (ovlen == 0 && p1 < endp) | ||
| 2715 | ovstr_done = 0; | ||
| 2693 | } | 2716 | } |
| 2694 | } | 2717 | } |
| 2695 | 2718 | ||
| @@ -3208,6 +3231,7 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 3208 | } | 3231 | } |
| 3209 | 3232 | ||
| 3210 | val.bufpos = pos; | 3233 | val.bufpos = pos; |
| 3234 | val.ovstring_chars_done = ovstr_done; | ||
| 3211 | val_display_text_line = val; | 3235 | val_display_text_line = val; |
| 3212 | return &val_display_text_line; | 3236 | return &val_display_text_line; |
| 3213 | } | 3237 | } |