aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-04-05 07:43:21 +0000
committerRichard M. Stallman1994-04-05 07:43:21 +0000
commitd2f846543a9977bfa932c87177a31f330ccb505c (patch)
tree2de53e03675522bffbda61a60a0fabfb1b42c37a /src
parente444162e0facc9d871146bd9181ad81f412a0df1 (diff)
downloademacs-d2f846543a9977bfa932c87177a31f330ccb505c.tar.gz
emacs-d2f846543a9977bfa932c87177a31f330ccb505c.zip
(display_text_line): Rename startp to leftmargin.
Use that, not p1start, when checking for char off left edge. (mark_window_display_accurate, redisplay): Set window_end_valid to the buffer displayed, not Qt.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c87
1 files changed, 52 insertions, 35 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index f626bc83a48..894b46ff540 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -836,7 +836,7 @@ update:
836 { 836 {
837 w->update_mode_line = Qnil; 837 w->update_mode_line = Qnil;
838 XFASTINT (w->last_modified) = BUF_MODIFF (b); 838 XFASTINT (w->last_modified) = BUF_MODIFF (b);
839 w->window_end_valid = Qt; 839 w->window_end_valid = w->buffer;
840 last_arrow_position = Voverlay_arrow_position; 840 last_arrow_position = Voverlay_arrow_position;
841 last_arrow_string = Voverlay_arrow_string; 841 last_arrow_string = Voverlay_arrow_string;
842 if (do_verify_charstarts) 842 if (do_verify_charstarts)
@@ -910,7 +910,7 @@ mark_window_display_accurate (window, flag)
910 : Qnil); 910 : Qnil);
911 } 911 }
912 912
913 w->window_end_valid = Qt; 913 w->window_end_valid = w->buffer;
914 w->update_mode_line = Qnil; 914 w->update_mode_line = Qnil;
915 915
916 if (!NILP (w->vchild)) 916 if (!NILP (w->vchild))
@@ -1635,7 +1635,24 @@ try_window_id (window)
1635 tem = scroll_frame_lines (f, bp.vpos + top - scroll_amount, 1635 tem = scroll_frame_lines (f, bp.vpos + top - scroll_amount,
1636 top + height - max (0, scroll_amount), 1636 top + height - max (0, scroll_amount),
1637 scroll_amount, bp.bufpos); 1637 scroll_amount, bp.bufpos);
1638 if (!tem) stop_vpos = height; 1638 if (!tem)
1639 stop_vpos = height;
1640 else
1641 {
1642 /* scroll_frame_lines did not properly adjust subsequent
1643 lines' charstarts in the case where the text of the
1644 screen line at bp.vpos has changed.
1645 (This can happen in a deletion that ends in mid-line.)
1646 To adjust properly, we need to make things constent at
1647 the position ep.
1648 So do a second adjust to make that happen.
1649 Note that stop_vpos >= ep.vpos, so it is sufficient
1650 to update the charstarts for lines at ep.vpos and below. */
1651 int oldstart
1652 = FRAME_CURRENT_GLYPHS (f)->charstarts[ep.vpos + top][0];
1653 adjust_window_charstarts (w, ep.vpos + top - 1,
1654 ep.bufpos - oldstart);
1655 }
1639 } 1656 }
1640 else if (scroll_amount) 1657 else if (scroll_amount)
1641 { 1658 {
@@ -1966,7 +1983,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
1966 register int pause; 1983 register int pause;
1967 register unsigned char *p; 1984 register unsigned char *p;
1968 GLYPH *endp; 1985 GLYPH *endp;
1969 register GLYPH *startp; 1986 register GLYPH *leftmargin;
1970 register GLYPH *p1prev = 0; 1987 register GLYPH *p1prev = 0;
1971 register GLYPH *p1start; 1988 register GLYPH *p1start;
1972 int *charstart; 1989 int *charstart;
@@ -1978,10 +1995,10 @@ display_text_line (w, start, vpos, hpos, taboffset)
1978 int lastpos; 1995 int lastpos;
1979 int invis; 1996 int invis;
1980 int hscroll = XINT (w->hscroll); 1997 int hscroll = XINT (w->hscroll);
1981 int truncate = hscroll 1998 int truncate = (hscroll
1982 || (truncate_partial_width_windows 1999 || (truncate_partial_width_windows
1983 && XFASTINT (w->width) < FRAME_WIDTH (f)) 2000 && XFASTINT (w->width) < FRAME_WIDTH (f))
1984 || !NILP (current_buffer->truncate_lines); 2001 || !NILP (current_buffer->truncate_lines));
1985 2002
1986 /* 1 if we should highlight the region. */ 2003 /* 1 if we should highlight the region. */
1987 int highlight_region 2004 int highlight_region
@@ -2071,8 +2088,8 @@ display_text_line (w, start, vpos, hpos, taboffset)
2071 /* In case we don't ever write anything into it... */ 2088 /* In case we don't ever write anything into it... */
2072 *charstart = -1; 2089 *charstart = -1;
2073 end = ZV; 2090 end = ZV;
2074 startp = desired_glyphs->glyphs[vpos] + XFASTINT (w->left); 2091 leftmargin = desired_glyphs->glyphs[vpos] + XFASTINT (w->left);
2075 endp = startp + width; 2092 endp = leftmargin + width;
2076 2093
2077 /* Arrange the overlays nicely for our purposes. Usually, we call 2094 /* Arrange the overlays nicely for our purposes. Usually, we call
2078 display_text_line on only one line at a time, in which case this 2095 display_text_line on only one line at a time, in which case this
@@ -2094,7 +2111,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2094 { 2111 {
2095 /* Record which glyph starts a character, 2112 /* Record which glyph starts a character,
2096 and the character position of that character. */ 2113 and the character position of that character. */
2097 if (p1 >= p1start) 2114 if (p1 >= leftmargin)
2098 charstart[p1 - p1start] = pos; 2115 charstart[p1 - p1start] = pos;
2099 2116
2100 if (p1 >= endp) 2117 if (p1 >= endp)
@@ -2112,7 +2129,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2112 if (pos == point && cursor_vpos < 0) 2129 if (pos == point && cursor_vpos < 0)
2113 { 2130 {
2114 cursor_vpos = vpos; 2131 cursor_vpos = vpos;
2115 cursor_hpos = p1 - startp; 2132 cursor_hpos = p1 - leftmargin;
2116 } 2133 }
2117 2134
2118#ifdef USE_TEXT_PROPERTIES 2135#ifdef USE_TEXT_PROPERTIES
@@ -2140,7 +2157,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2140 if (pos < point && next_invisible >= point) 2157 if (pos < point && next_invisible >= point)
2141 { 2158 {
2142 cursor_vpos = vpos; 2159 cursor_vpos = vpos;
2143 cursor_hpos = p1 - startp; 2160 cursor_hpos = p1 - leftmargin;
2144 } 2161 }
2145 pos = next_invisible; 2162 pos = next_invisible;
2146 } 2163 }
@@ -2181,7 +2198,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2181 if (c >= 040 && c < 0177 2198 if (c >= 040 && c < 0177
2182 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector)) 2199 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector))
2183 { 2200 {
2184 if (p1 >= startp) 2201 if (p1 >= leftmargin)
2185 *p1 = MAKE_GLYPH (f, c, current_face); 2202 *p1 = MAKE_GLYPH (f, c, current_face);
2186 p1++; 2203 p1++;
2187 } 2204 }
@@ -2197,10 +2214,10 @@ display_text_line (w, start, vpos, hpos, taboffset)
2197 if (FETCH_CHAR (pos - 1) == '\n') 2214 if (FETCH_CHAR (pos - 1) == '\n')
2198 pos--; 2215 pos--;
2199 } 2216 }
2200 if (invis && selective_rlen > 0 && p1 >= startp) 2217 if (invis && selective_rlen > 0 && p1 >= leftmargin)
2201 { 2218 {
2202 p1 += selective_rlen; 2219 p1 += selective_rlen;
2203 if (p1 - startp > width) 2220 if (p1 - leftmargin > width)
2204 p1 = endp; 2221 p1 = endp;
2205 copy_part_of_rope (f, p1prev, p1prev, invis_vector_contents, 2222 copy_part_of_rope (f, p1prev, p1prev, invis_vector_contents,
2206 (p1 - p1prev), current_face); 2223 (p1 - p1prev), current_face);
@@ -2218,11 +2235,11 @@ display_text_line (w, start, vpos, hpos, taboffset)
2218 { 2235 {
2219 do 2236 do
2220 { 2237 {
2221 if (p1 >= startp && p1 < endp) 2238 if (p1 >= leftmargin && p1 < endp)
2222 *p1 = MAKE_GLYPH (f, ' ', current_face); 2239 *p1 = MAKE_GLYPH (f, ' ', current_face);
2223 p1++; 2240 p1++;
2224 } 2241 }
2225 while ((p1 - startp + taboffset + hscroll - (hscroll > 0)) 2242 while ((p1 - leftmargin + taboffset + hscroll - (hscroll > 0))
2226 % tab_width); 2243 % tab_width);
2227 } 2244 }
2228 else if (c == Ctl ('M') && selective == -1) 2245 else if (c == Ctl ('M') && selective == -1)
@@ -2233,7 +2250,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2233 if (selective_rlen > 0) 2250 if (selective_rlen > 0)
2234 { 2251 {
2235 p1 += selective_rlen; 2252 p1 += selective_rlen;
2236 if (p1 - startp > width) 2253 if (p1 - leftmargin > width)
2237 p1 = endp; 2254 p1 = endp;
2238 copy_part_of_rope (f, p1prev, p1prev, invis_vector_contents, 2255 copy_part_of_rope (f, p1prev, p1prev, invis_vector_contents,
2239 (p1 - p1prev), current_face); 2256 (p1 - p1prev), current_face);
@@ -2249,42 +2266,42 @@ display_text_line (w, start, vpos, hpos, taboffset)
2249 } 2266 }
2250 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector) 2267 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector)
2251 { 2268 {
2252 p1 = copy_part_of_rope (f, p1, startp, 2269 p1 = copy_part_of_rope (f, p1, leftmargin,
2253 XVECTOR (DISP_CHAR_VECTOR (dp, c))->contents, 2270 XVECTOR (DISP_CHAR_VECTOR (dp, c))->contents,
2254 XVECTOR (DISP_CHAR_VECTOR (dp, c))->size, 2271 XVECTOR (DISP_CHAR_VECTOR (dp, c))->size,
2255 current_face); 2272 current_face);
2256 } 2273 }
2257 else if (c < 0200 && ctl_arrow) 2274 else if (c < 0200 && ctl_arrow)
2258 { 2275 {
2259 if (p1 >= startp) 2276 if (p1 >= leftmargin)
2260 *p1 = fix_glyph (f, (dp && XTYPE (DISP_CTRL_GLYPH (dp)) == Lisp_Int 2277 *p1 = fix_glyph (f, (dp && XTYPE (DISP_CTRL_GLYPH (dp)) == Lisp_Int
2261 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'), 2278 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'),
2262 current_face); 2279 current_face);
2263 p1++; 2280 p1++;
2264 if (p1 >= startp && p1 < endp) 2281 if (p1 >= leftmargin && p1 < endp)
2265 *p1 = MAKE_GLYPH (f, c ^ 0100, current_face); 2282 *p1 = MAKE_GLYPH (f, c ^ 0100, current_face);
2266 p1++; 2283 p1++;
2267 } 2284 }
2268 else 2285 else
2269 { 2286 {
2270 if (p1 >= startp) 2287 if (p1 >= leftmargin)
2271 *p1 = fix_glyph (f, (dp && XTYPE (DISP_ESCAPE_GLYPH (dp)) == Lisp_Int 2288 *p1 = fix_glyph (f, (dp && XTYPE (DISP_ESCAPE_GLYPH (dp)) == Lisp_Int
2272 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'), 2289 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'),
2273 current_face); 2290 current_face);
2274 p1++; 2291 p1++;
2275 if (p1 >= startp && p1 < endp) 2292 if (p1 >= leftmargin && p1 < endp)
2276 *p1 = MAKE_GLYPH (f, (c >> 6) + '0', current_face); 2293 *p1 = MAKE_GLYPH (f, (c >> 6) + '0', current_face);
2277 p1++; 2294 p1++;
2278 if (p1 >= startp && p1 < endp) 2295 if (p1 >= leftmargin && p1 < endp)
2279 *p1 = MAKE_GLYPH (f, (7 & (c >> 3)) + '0', current_face); 2296 *p1 = MAKE_GLYPH (f, (7 & (c >> 3)) + '0', current_face);
2280 p1++; 2297 p1++;
2281 if (p1 >= startp && p1 < endp) 2298 if (p1 >= leftmargin && p1 < endp)
2282 *p1 = MAKE_GLYPH (f, (7 & c) + '0', current_face); 2299 *p1 = MAKE_GLYPH (f, (7 & c) + '0', current_face);
2283 p1++; 2300 p1++;
2284 } 2301 }
2285 2302
2286 /* Do nothing here for a char that's entirely off the left edge. */ 2303 /* Do nothing here for a char that's entirely off the left edge. */
2287 if (p1 >= p1start) 2304 if (p1 >= leftmargin)
2288 { 2305 {
2289 /* For all the glyphs occupied by this character, except for the 2306 /* For all the glyphs occupied by this character, except for the
2290 first, store -1 in charstarts. */ 2307 first, store -1 in charstarts. */
@@ -2296,7 +2313,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2296 /* The window's left column should always 2313 /* The window's left column should always
2297 contain a character position. 2314 contain a character position.
2298 And don't clobber anything to the left of that. */ 2315 And don't clobber anything to the left of that. */
2299 if (p1prev < p1start) 2316 if (p1prev < leftmargin)
2300 { 2317 {
2301 charstart[0] = pos; 2318 charstart[0] = pos;
2302 p2x = charstart; 2319 p2x = charstart;
@@ -2395,7 +2412,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2395 if (start <= point && point <= lastpos && cursor_vpos < 0) 2412 if (start <= point && point <= lastpos && cursor_vpos < 0)
2396 { 2413 {
2397 cursor_vpos = vpos; 2414 cursor_vpos = vpos;
2398 cursor_hpos = p1 - startp; 2415 cursor_hpos = p1 - leftmargin;
2399 } 2416 }
2400 2417
2401 if (cursor_vpos == vpos) 2418 if (cursor_vpos == vpos)
@@ -2431,15 +2448,15 @@ display_text_line (w, start, vpos, hpos, taboffset)
2431 /* If hscroll and line not empty, insert truncation-at-left marker */ 2448 /* If hscroll and line not empty, insert truncation-at-left marker */
2432 if (hscroll && lastpos != start) 2449 if (hscroll && lastpos != start)
2433 { 2450 {
2434 *startp = fix_glyph (f, truncator, 0); 2451 *leftmargin = fix_glyph (f, truncator, 0);
2435 if (p1 <= startp) 2452 if (p1 <= leftmargin)
2436 p1 = startp + 1; 2453 p1 = leftmargin + 1;
2437 } 2454 }
2438 2455
2439 if (XFASTINT (w->width) + XFASTINT (w->left) != FRAME_WIDTH (f)) 2456 if (XFASTINT (w->width) + XFASTINT (w->left) != FRAME_WIDTH (f))
2440 { 2457 {
2441 endp++; 2458 endp++;
2442 if (p1 < startp) p1 = startp; 2459 if (p1 < leftmargin) p1 = leftmargin;
2443 while (p1 < endp) *p1++ = SPACEGLYPH; 2460 while (p1 < endp) *p1++ = SPACEGLYPH;
2444 2461
2445 /* Don't draw vertical bars if we're using scroll bars. They're 2462 /* Don't draw vertical bars if we're using scroll bars. They're
@@ -2470,10 +2487,10 @@ display_text_line (w, start, vpos, hpos, taboffset)
2470 if (len > width) 2487 if (len > width)
2471 len = width; 2488 len = width;
2472 for (i = 0; i < len; i++) 2489 for (i = 0; i < len; i++)
2473 startp[i] = p[i]; 2490 leftmargin[i] = p[i];
2474 2491
2475 /* Bug in SunOS 4.1.1 compiler requires this intermediate variable. */ 2492 /* Bug in SunOS 4.1.1 compiler requires this intermediate variable. */
2476 arrow_end = (startp - desired_glyphs->glyphs[vpos]) + len; 2493 arrow_end = (leftmargin - desired_glyphs->glyphs[vpos]) + len;
2477 if (desired_glyphs->used[vpos] < arrow_end) 2494 if (desired_glyphs->used[vpos] < arrow_end)
2478 desired_glyphs->used[vpos] = arrow_end; 2495 desired_glyphs->used[vpos] = arrow_end;
2479 2496