Mercurial > emacs
comparison src/xdisp.c @ 6612:1462bf31ef3c
(redisplay): Call frame_up_to_date_hook.
(display_text_line): Pass new arg to compute_char_face.
Fill in charstarts array.
(display_string): Clear part of charstarts array.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 31 Mar 1994 18:40:11 +0000 |
parents | c87ae1f14148 |
children | b3631c88ec7e |
comparison
equal
deleted
inserted
replaced
6611:a5f180172ff3 | 6612:1462bf31ef3c |
---|---|
737 f = XFRAME (XCONS (tail)->car); | 737 f = XFRAME (XCONS (tail)->car); |
738 if (FRAME_VISIBLE_P (f)) | 738 if (FRAME_VISIBLE_P (f)) |
739 { | 739 { |
740 pause |= update_frame (f, 0, 0); | 740 pause |= update_frame (f, 0, 0); |
741 if (!pause) | 741 if (!pause) |
742 mark_window_display_accurate (f->root_window, 1); | 742 { |
743 mark_window_display_accurate (f->root_window, 1); | |
744 if (frame_up_to_date_hook != 0) | |
745 (*frame_up_to_date_hook) (f); | |
746 } | |
743 } | 747 } |
744 } | 748 } |
745 } | 749 } |
746 else | 750 else |
747 #endif /* MULTI_FRAME */ | 751 #endif /* MULTI_FRAME */ |
753 function. If the echo area is on another frame, that may | 757 function. If the echo area is on another frame, that may |
754 have put text on a frame other than the selected one, so the | 758 have put text on a frame other than the selected one, so the |
755 above call to update_frame would not have caught it. Catch | 759 above call to update_frame would not have caught it. Catch |
756 it here. */ | 760 it here. */ |
757 { | 761 { |
758 FRAME_PTR mini_frame = | 762 FRAME_PTR mini_frame |
759 XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window))); | 763 = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window))); |
760 | 764 |
761 if (mini_frame != selected_frame) | 765 if (mini_frame != selected_frame) |
762 pause |= update_frame (mini_frame, 0, 0); | 766 pause |= update_frame (mini_frame, 0, 0); |
763 } | 767 } |
764 } | 768 } |
805 w->update_mode_line = Qnil; | 809 w->update_mode_line = Qnil; |
806 XFASTINT (w->last_modified) = BUF_MODIFF (b); | 810 XFASTINT (w->last_modified) = BUF_MODIFF (b); |
807 w->window_end_valid = Qt; | 811 w->window_end_valid = Qt; |
808 last_arrow_position = Voverlay_arrow_position; | 812 last_arrow_position = Voverlay_arrow_position; |
809 last_arrow_string = Voverlay_arrow_string; | 813 last_arrow_string = Voverlay_arrow_string; |
814 if (frame_up_to_date_hook != 0) | |
815 (*frame_up_to_date_hook) (selected_frame); | |
810 } | 816 } |
811 update_mode_lines = 0; | 817 update_mode_lines = 0; |
812 windows_or_buffers_changed = 0; | 818 windows_or_buffers_changed = 0; |
813 } | 819 } |
814 | 820 |
1923 register int pause; | 1929 register int pause; |
1924 register unsigned char *p; | 1930 register unsigned char *p; |
1925 GLYPH *endp; | 1931 GLYPH *endp; |
1926 register GLYPH *startp; | 1932 register GLYPH *startp; |
1927 register GLYPH *p1prev = 0; | 1933 register GLYPH *p1prev = 0; |
1934 register GLYPH *p1start; | |
1935 int *charstart; | |
1928 FRAME_PTR f = XFRAME (w->frame); | 1936 FRAME_PTR f = XFRAME (w->frame); |
1929 int tab_width = XINT (current_buffer->tab_width); | 1937 int tab_width = XINT (current_buffer->tab_width); |
1930 int ctl_arrow = !NILP (current_buffer->ctl_arrow); | 1938 int ctl_arrow = !NILP (current_buffer->ctl_arrow); |
1931 int width = window_internal_width (w) - 1; | 1939 int width = window_internal_width (w) - 1; |
1932 struct position val; | 1940 struct position val; |
1979 int next_invisible; | 1987 int next_invisible; |
1980 #endif | 1988 #endif |
1981 | 1989 |
1982 /* The face we're currently using. */ | 1990 /* The face we're currently using. */ |
1983 int current_face = 0; | 1991 int current_face = 0; |
1992 int i; | |
1984 | 1993 |
1985 XFASTINT (default_invis_vector[2]) = '.'; | 1994 XFASTINT (default_invis_vector[2]) = '.'; |
1986 default_invis_vector[0] = default_invis_vector[1] = default_invis_vector[2]; | 1995 default_invis_vector[0] = default_invis_vector[1] = default_invis_vector[2]; |
1987 | 1996 |
1988 hpos += XFASTINT (w->left); | 1997 hpos += XFASTINT (w->left); |
2018 minibuf_prompt_width = hpos; | 2027 minibuf_prompt_width = hpos; |
2019 } | 2028 } |
2020 | 2029 |
2021 desired_glyphs->bufp[vpos] = pos; | 2030 desired_glyphs->bufp[vpos] = pos; |
2022 p1 = desired_glyphs->glyphs[vpos] + hpos; | 2031 p1 = desired_glyphs->glyphs[vpos] + hpos; |
2032 p1start = p1; | |
2033 charstart = desired_glyphs->charstarts[vpos] + hpos; | |
2034 /* In case we don't ever write anything into it... */ | |
2035 *charstart = -1; | |
2023 end = ZV; | 2036 end = ZV; |
2024 startp = desired_glyphs->glyphs[vpos] + XFASTINT (w->left); | 2037 startp = desired_glyphs->glyphs[vpos] + XFASTINT (w->left); |
2025 endp = startp + width; | 2038 endp = startp + width; |
2026 | 2039 |
2027 /* Arrange the overlays nicely for our purposes. Usually, we call | 2040 /* Arrange the overlays nicely for our purposes. Usually, we call |
2040 #ifdef USE_TEXT_PROPERTIES | 2053 #ifdef USE_TEXT_PROPERTIES |
2041 next_invisible = pos; | 2054 next_invisible = pos; |
2042 #endif | 2055 #endif |
2043 while (p1 < endp) | 2056 while (p1 < endp) |
2044 { | 2057 { |
2058 /* Record which glyph starts a character, | |
2059 and the character position of that character. */ | |
2060 charstart[p1 - p1start] = pos; | |
2061 | |
2045 p1prev = p1; | 2062 p1prev = p1; |
2046 if (pos >= pause) | 2063 if (pos >= pause) |
2047 { | 2064 { |
2048 /* Did we hit the end of the visible region of the buffer? | 2065 /* Did we hit the end of the visible region of the buffer? |
2049 Stop here. */ | 2066 Stop here. */ |
2096 use now. We also hit this the first time through the | 2113 use now. We also hit this the first time through the |
2097 loop, to see what face we should start with. */ | 2114 loop, to see what face we should start with. */ |
2098 if (pos >= next_face_change && FRAME_X_P (f)) | 2115 if (pos >= next_face_change && FRAME_X_P (f)) |
2099 current_face = compute_char_face (f, w, pos, | 2116 current_face = compute_char_face (f, w, pos, |
2100 region_beg, region_end, | 2117 region_beg, region_end, |
2101 &next_face_change, pos + 50); | 2118 &next_face_change, pos + 50, 0); |
2102 #endif | 2119 #endif |
2103 | 2120 |
2104 pause = end; | 2121 pause = end; |
2105 | 2122 |
2106 #ifdef USE_TEXT_PROPERTIES | 2123 #ifdef USE_TEXT_PROPERTIES |
2223 if (p1 >= startp && p1 < endp) | 2240 if (p1 >= startp && p1 < endp) |
2224 *p1 = MAKE_GLYPH (f, (7 & c) + '0', current_face); | 2241 *p1 = MAKE_GLYPH (f, (7 & c) + '0', current_face); |
2225 p1++; | 2242 p1++; |
2226 } | 2243 } |
2227 | 2244 |
2245 /* For all the glyphs occupied by this character, except for the | |
2246 first, store -1 in charstarts. */ | |
2247 if (p1 != p1prev) | |
2248 { | |
2249 int *p2x = &charstart[p1prev - p1start] + 1; | |
2250 int *p2 = &charstart[p1 - p1start]; | |
2251 while (p2x != p2) | |
2252 *p2x++ = -1; | |
2253 } | |
2254 else | |
2255 /* If this character took up no space, | |
2256 erase all mention of it from charstart. */ | |
2257 charstart[p1 - p1start] = 0; | |
2228 pos++; | 2258 pos++; |
2229 } | 2259 } |
2230 | 2260 |
2231 val.hpos = - XINT (w->hscroll); | 2261 val.hpos = - XINT (w->hscroll); |
2232 if (val.hpos) | 2262 if (val.hpos) |
2233 val.hpos++; | 2263 val.hpos++; |
2234 | 2264 |
2235 val.vpos = 1; | 2265 val.vpos = 1; |
2236 | 2266 |
2237 lastpos = pos; | 2267 lastpos = pos; |
2268 | |
2269 /* Store 0 in this charstart line for the positions where | |
2270 there is no character. But do leave what was recorded | |
2271 for the character that ended the line. */ | |
2272 for (i = p1 - p1start + 1; i < endp - p1start; i++) | |
2273 charstart[i] = 0; | |
2238 | 2274 |
2239 /* Handle continuation in middle of a character */ | 2275 /* Handle continuation in middle of a character */ |
2240 /* by backing up over it */ | 2276 /* by backing up over it */ |
2241 if (p1 > endp) | 2277 if (p1 > endp) |
2242 { | 2278 { |
3065 int window_width = XFASTINT (w->width); | 3101 int window_width = XFASTINT (w->width); |
3066 | 3102 |
3067 /* Use the standard display table, not the window's display table. | 3103 /* Use the standard display table, not the window's display table. |
3068 We don't want the mode line in rot13. */ | 3104 We don't want the mode line in rot13. */ |
3069 register struct Lisp_Vector *dp = 0; | 3105 register struct Lisp_Vector *dp = 0; |
3106 int i; | |
3070 | 3107 |
3071 if (XTYPE (Vstandard_display_table) == Lisp_Vector | 3108 if (XTYPE (Vstandard_display_table) == Lisp_Vector |
3072 && XVECTOR (Vstandard_display_table)->size == DISP_TABLE_SIZE) | 3109 && XVECTOR (Vstandard_display_table)->size == DISP_TABLE_SIZE) |
3073 dp = XVECTOR (Vstandard_display_table); | 3110 dp = XVECTOR (Vstandard_display_table); |
3074 | 3111 |
3096 } | 3133 } |
3097 | 3134 |
3098 if (! obey_window_width | 3135 if (! obey_window_width |
3099 || (maxcol >= 0 && end - desired_glyphs->glyphs[vpos] > maxcol)) | 3136 || (maxcol >= 0 && end - desired_glyphs->glyphs[vpos] > maxcol)) |
3100 end = desired_glyphs->glyphs[vpos] + maxcol; | 3137 end = desired_glyphs->glyphs[vpos] + maxcol; |
3138 | |
3139 /* Store 0 in charstart for these columns. */ | |
3140 for (i = hpos; i < end - p1start + hpos; i++) | |
3141 desired_glyphs->charstarts[vpos][i] = 0; | |
3101 | 3142 |
3102 if (maxcol >= 0 && mincol > maxcol) | 3143 if (maxcol >= 0 && mincol > maxcol) |
3103 mincol = maxcol; | 3144 mincol = maxcol; |
3104 | 3145 |
3105 while (p1 < end) | 3146 while (p1 < end) |