Mercurial > emacs
comparison src/xdisp.c @ 38041:ae548ba56493
(try_window_id): When EOB is visible, don't treat
insertion at EOB as if it were "off the bottom of the screen."
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 14 Jun 2001 21:01:07 +0000 |
parents | 2a1bebae1d80 |
children | 22571591f506 |
comparison
equal
deleted
inserted
replaced
38040:79be85ef3a31 | 38041:ae548ba56493 |
---|---|
11104 | 11104 |
11105 /* This flag is used to prevent redisplay optimizations. */ | 11105 /* This flag is used to prevent redisplay optimizations. */ |
11106 if (windows_or_buffers_changed) | 11106 if (windows_or_buffers_changed) |
11107 GIVE_UP (2); | 11107 GIVE_UP (2); |
11108 | 11108 |
11109 /* Narrowing has not changed. This flag is also set to prevent | 11109 /* Verify that narrowing has not changed. This flag is also set to prevent |
11110 redisplay optimizations. It would be nice to further | 11110 redisplay optimizations. It would be nice to further |
11111 reduce the number of cases where this prevents try_window_id. */ | 11111 reduce the number of cases where this prevents try_window_id. */ |
11112 if (current_buffer->clip_changed) | 11112 if (current_buffer->clip_changed) |
11113 GIVE_UP (3); | 11113 GIVE_UP (3); |
11114 | 11114 |
11116 if (!FRAME_WINDOW_P (f) | 11116 if (!FRAME_WINDOW_P (f) |
11117 && (!line_ins_del_ok | 11117 && (!line_ins_del_ok |
11118 || !WINDOW_FULL_WIDTH_P (w))) | 11118 || !WINDOW_FULL_WIDTH_P (w))) |
11119 GIVE_UP (4); | 11119 GIVE_UP (4); |
11120 | 11120 |
11121 /* Point is not known NOT to appear in W. */ | 11121 /* Give up if point is not known NOT to appear in W. */ |
11122 if (PT < CHARPOS (start)) | 11122 if (PT < CHARPOS (start)) |
11123 GIVE_UP (5); | 11123 GIVE_UP (5); |
11124 | 11124 |
11125 /* Another way to prevent redisplay optimizations. */ | 11125 /* Another way to prevent redisplay optimizations. */ |
11126 if (XFASTINT (w->last_modified) == 0) | 11126 if (XFASTINT (w->last_modified) == 0) |
11127 GIVE_UP (6); | 11127 GIVE_UP (6); |
11128 | 11128 |
11129 /* Window is not hscrolled. */ | 11129 /* Verify that window is not hscrolled. */ |
11130 if (XFASTINT (w->hscroll) != 0) | 11130 if (XFASTINT (w->hscroll) != 0) |
11131 GIVE_UP (7); | 11131 GIVE_UP (7); |
11132 | 11132 |
11133 /* Display wasn't paused. */ | 11133 /* Verify that display wasn't paused. */ |
11134 if (NILP (w->window_end_valid)) | 11134 if (NILP (w->window_end_valid)) |
11135 GIVE_UP (8); | 11135 GIVE_UP (8); |
11136 | 11136 |
11137 /* Can't use this if highlighting a region because a cursor movement | 11137 /* Can't use this if highlighting a region because a cursor movement |
11138 will do more than just set the cursor. */ | 11138 will do more than just set the cursor. */ |
11224 return 1; | 11224 return 1; |
11225 } | 11225 } |
11226 } | 11226 } |
11227 | 11227 |
11228 /* Handle the case that changes are all below what is displayed in | 11228 /* Handle the case that changes are all below what is displayed in |
11229 the window, and that PT is in the window. */ | 11229 the window, and that PT is in the window. |
11230 if (first_changed_charpos >= MATRIX_ROW_END_CHARPOS (row)) | 11230 RMS: This used to use >=, but that was spuriously true |
11231 when inserting at the end of buffer when the end of buffer | |
11232 was visible on the screen. I think it is safe now, | |
11233 because the test now insists there is a character between the end of | |
11234 the last screen row used and the first change, and that character | |
11235 must not off the bottom of the screen. */ | |
11236 if (first_changed_charpos > MATRIX_ROW_END_CHARPOS (row)) | |
11231 { | 11237 { |
11232 struct glyph_row *r0; | 11238 struct glyph_row *r0; |
11233 | 11239 |
11234 /* Give up if PT is not in the window. Note that it already has | 11240 /* Give up if PT is not in the window. Note that it already has |
11235 been checked at the start of try_window_id that PT is not in | 11241 been checked at the start of try_window_id that PT is not in |
11255 set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); | 11261 set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); |
11256 return 2; | 11262 return 2; |
11257 } | 11263 } |
11258 } | 11264 } |
11259 | 11265 |
11266 /* Give up if window start is in the changed area | |
11267 if the total size has changed. */ | |
11268 /* RMS: Is it really relevant whether the total size has changed? | |
11269 Why should that matter? */ | |
11270 if (BEG_UNCHANGED + END_UNCHANGED != Z - BEG | |
11271 && CHARPOS (start) >= first_changed_charpos | |
11272 && CHARPOS (start) <= last_changed_charpos) | |
11273 GIVE_UP (15); | |
11274 | |
11260 /* Check that window start agrees with the start of the first glyph | 11275 /* Check that window start agrees with the start of the first glyph |
11261 row in its current matrix. Check this after we know the window | 11276 row in its current matrix. Check this after we know the window |
11262 start is not in changed text, otherwise positions would not be | 11277 start is not in changed text, otherwise positions would not be |
11263 comparable. */ | 11278 comparable. */ |
11264 if (BEG_UNCHANGED + END_UNCHANGED != Z - BEG | |
11265 && CHARPOS (start) >= first_changed_charpos | |
11266 && CHARPOS (start) <= last_changed_charpos) | |
11267 GIVE_UP (15); | |
11268 | |
11269 row = MATRIX_FIRST_TEXT_ROW (current_matrix); | 11279 row = MATRIX_FIRST_TEXT_ROW (current_matrix); |
11270 if (!TEXT_POS_EQUAL_P (start, row->start.pos)) | 11280 if (!TEXT_POS_EQUAL_P (start, row->start.pos)) |
11271 GIVE_UP (16); | 11281 GIVE_UP (16); |
11272 | 11282 |
11273 /* Compute the position at which we have to start displaying new | 11283 /* Compute the position at which we have to start displaying new |