diff options
| author | Gerd Moellmann | 2000-10-16 15:39:59 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-10-16 15:39:59 +0000 |
| commit | 1ec185cb4a326eb403b0d4ee2ee641c074139b3b (patch) | |
| tree | 89172b304b9a7050d2d507863372be385eaedee2 | |
| parent | 313fe58a8931a4a5da20fbbb20a8ed83086169a9 (diff) | |
| download | emacs-1ec185cb4a326eb403b0d4ee2ee641c074139b3b.tar.gz emacs-1ec185cb4a326eb403b0d4ee2ee641c074139b3b.zip | |
(find_last_unchanged_at_beg_row): Renamed from
get_last_unchanged_at_beg_row.
(find_first_unchanged_at_end_row): Renamed from
get_first_unchanged_at_end_row.
(find_first_unchanged_at_end_row): Convert assertions to
unconditional tests which abort. When looking for a row in
unchanged text, don't go further back than first_text_row.
| -rw-r--r-- | src/xdisp.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index fdb5ef669a5..bc69ef3d9f7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10169,8 +10169,8 @@ try_window_reusing_current_matrix (w) | |||
| 10169 | Window redisplay reusing current matrix when buffer has changed | 10169 | Window redisplay reusing current matrix when buffer has changed |
| 10170 | ************************************************************************/ | 10170 | ************************************************************************/ |
| 10171 | 10171 | ||
| 10172 | static struct glyph_row *get_last_unchanged_at_beg_row P_ ((struct window *)); | 10172 | static struct glyph_row *find_last_unchanged_at_beg_row P_ ((struct window *)); |
| 10173 | static struct glyph_row *get_first_unchanged_at_end_row P_ ((struct window *, | 10173 | static struct glyph_row *find_first_unchanged_at_end_row P_ ((struct window *, |
| 10174 | int *, int *)); | 10174 | int *, int *)); |
| 10175 | static struct glyph_row * | 10175 | static struct glyph_row * |
| 10176 | find_last_row_displaying_text P_ ((struct glyph_matrix *, struct it *, | 10176 | find_last_row_displaying_text P_ ((struct glyph_matrix *, struct it *, |
| @@ -10220,7 +10220,7 @@ find_last_row_displaying_text (matrix, it, start) | |||
| 10220 | was built. */ | 10220 | was built. */ |
| 10221 | 10221 | ||
| 10222 | static struct glyph_row * | 10222 | static struct glyph_row * |
| 10223 | get_last_unchanged_at_beg_row (w) | 10223 | find_last_unchanged_at_beg_row (w) |
| 10224 | struct window *w; | 10224 | struct window *w; |
| 10225 | { | 10225 | { |
| 10226 | int first_changed_pos = BEG + BEG_UNCHANGED; | 10226 | int first_changed_pos = BEG + BEG_UNCHANGED; |
| @@ -10266,7 +10266,7 @@ get_last_unchanged_at_beg_row (w) | |||
| 10266 | exists, i.e. all rows are affected by changes. */ | 10266 | exists, i.e. all rows are affected by changes. */ |
| 10267 | 10267 | ||
| 10268 | static struct glyph_row * | 10268 | static struct glyph_row * |
| 10269 | get_first_unchanged_at_end_row (w, delta, delta_bytes) | 10269 | find_first_unchanged_at_end_row (w, delta, delta_bytes) |
| 10270 | struct window *w; | 10270 | struct window *w; |
| 10271 | int *delta, *delta_bytes; | 10271 | int *delta, *delta_bytes; |
| 10272 | { | 10272 | { |
| @@ -10275,10 +10275,14 @@ get_first_unchanged_at_end_row (w, delta, delta_bytes) | |||
| 10275 | 10275 | ||
| 10276 | *delta = *delta_bytes = 0; | 10276 | *delta = *delta_bytes = 0; |
| 10277 | 10277 | ||
| 10278 | /* A value of window_end_pos >= end_unchanged means that the window | 10278 | /* Display must not have been paused, otherwise the current matrix |
| 10279 | is not up to date. */ | ||
| 10280 | if (NILP (w->window_end_valid)) | ||
| 10281 | abort (); | ||
| 10282 | |||
| 10283 | /* A value of window_end_pos >= END_UNCHANGED means that the window | ||
| 10279 | end is in the range of changed text. If so, there is no | 10284 | end is in the range of changed text. If so, there is no |
| 10280 | unchanged row at the end of W's current matrix. */ | 10285 | unchanged row at the end of W's current matrix. */ |
| 10281 | xassert (!NILP (w->window_end_valid)); | ||
| 10282 | if (XFASTINT (w->window_end_pos) >= END_UNCHANGED) | 10286 | if (XFASTINT (w->window_end_pos) >= END_UNCHANGED) |
| 10283 | return NULL; | 10287 | return NULL; |
| 10284 | 10288 | ||
| @@ -10313,18 +10317,19 @@ get_first_unchanged_at_end_row (w, delta, delta_bytes) | |||
| 10313 | 10317 | ||
| 10314 | /* Search backward from ROW for a row displaying a line that | 10318 | /* Search backward from ROW for a row displaying a line that |
| 10315 | starts at a minimum position >= last_unchanged_pos_old. */ | 10319 | starts at a minimum position >= last_unchanged_pos_old. */ |
| 10316 | while (row >= first_text_row) | 10320 | for (; row > first_text_row; --row) |
| 10317 | { | 10321 | { |
| 10318 | xassert (row->enabled_p); | 10322 | if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row)) |
| 10319 | xassert (MATRIX_ROW_DISPLAYS_TEXT_P (row)); | 10323 | abort (); |
| 10320 | 10324 | ||
| 10321 | if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old) | 10325 | if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old) |
| 10322 | row_found = row; | 10326 | row_found = row; |
| 10323 | --row; | ||
| 10324 | } | 10327 | } |
| 10325 | } | 10328 | } |
| 10326 | 10329 | ||
| 10327 | xassert (!row_found || MATRIX_ROW_DISPLAYS_TEXT_P (row_found)); | 10330 | if (row_found && !MATRIX_ROW_DISPLAYS_TEXT_P (row_found)) |
| 10331 | abort (); | ||
| 10332 | |||
| 10328 | return row_found; | 10333 | return row_found; |
| 10329 | } | 10334 | } |
| 10330 | 10335 | ||
| @@ -10564,7 +10569,7 @@ try_window_id (w) | |||
| 10564 | last row in W's current matrix not affected by changes at the | 10569 | last row in W's current matrix not affected by changes at the |
| 10565 | start of current_buffer. Value is null if changes start in the | 10570 | start of current_buffer. Value is null if changes start in the |
| 10566 | first line of window. */ | 10571 | first line of window. */ |
| 10567 | last_unchanged_at_beg_row = get_last_unchanged_at_beg_row (w); | 10572 | last_unchanged_at_beg_row = find_last_unchanged_at_beg_row (w); |
| 10568 | if (last_unchanged_at_beg_row) | 10573 | if (last_unchanged_at_beg_row) |
| 10569 | { | 10574 | { |
| 10570 | init_to_row_end (&it, w, last_unchanged_at_beg_row); | 10575 | init_to_row_end (&it, w, last_unchanged_at_beg_row); |
| @@ -10595,7 +10600,7 @@ try_window_id (w) | |||
| 10595 | first_unchanged_at_end_row have to be adjusted due to text | 10600 | first_unchanged_at_end_row have to be adjusted due to text |
| 10596 | changes. */ | 10601 | changes. */ |
| 10597 | first_unchanged_at_end_row | 10602 | first_unchanged_at_end_row |
| 10598 | = get_first_unchanged_at_end_row (w, &delta, &delta_bytes); | 10603 | = find_first_unchanged_at_end_row (w, &delta, &delta_bytes); |
| 10599 | IF_DEBUG (debug_delta = delta); | 10604 | IF_DEBUG (debug_delta = delta); |
| 10600 | IF_DEBUG (debug_delta_bytes = delta_bytes); | 10605 | IF_DEBUG (debug_delta_bytes = delta_bytes); |
| 10601 | 10606 | ||