diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-cmds.el | 8 | ||||
| -rw-r--r-- | src/ChangeLog | 32 | ||||
| -rw-r--r-- | src/dispnew.c | 4 | ||||
| -rw-r--r-- | src/emacs.c | 3 | ||||
| -rw-r--r-- | src/fileio.c | 19 | ||||
| -rw-r--r-- | src/window.c | 29 | ||||
| -rw-r--r-- | src/window.h | 26 | ||||
| -rw-r--r-- | src/xdisp.c | 122 |
9 files changed, 126 insertions, 122 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6121ff190e8..8ab64694aad 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-22 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-cmds.el (tramp-bug, tramp-append-tramp-buffers): Mark | ||
| 4 | descriptive parts with `display' property. | ||
| 5 | |||
| 1 | 2013-01-21 Agustín Martín Domingo <agustin.martin@hispalinux.es> | 6 | 2013-01-21 Agustín Martín Domingo <agustin.martin@hispalinux.es> |
| 2 | 7 | ||
| 3 | * textmodes/ispell.el (ispell-hunspell-dictionary-equivs-alist): | 8 | * textmodes/ispell.el (ispell-hunspell-dictionary-equivs-alist): |
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 58469b22447..462f0d88367 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el | |||
| @@ -186,7 +186,7 @@ This includes password cache, file cache, connection cache, buffers." | |||
| 186 | 186 | ||
| 187 | 'tramp-load-report-modules ; pre-hook | 187 | 'tramp-load-report-modules ; pre-hook |
| 188 | 'tramp-append-tramp-buffers ; post-hook | 188 | 'tramp-append-tramp-buffers ; post-hook |
| 189 | "\ | 189 | (propertize "\n" 'display "\ |
| 190 | Enter your bug report in this message, including as much detail | 190 | Enter your bug report in this message, including as much detail |
| 191 | as you possibly can about the problem, what you did to cause it | 191 | as you possibly can about the problem, what you did to cause it |
| 192 | and what the local and remote machines are. | 192 | and what the local and remote machines are. |
| @@ -209,7 +209,7 @@ contents of the *tramp/foo* buffer and the *debug tramp/foo* | |||
| 209 | buffer in your bug report. | 209 | buffer in your bug report. |
| 210 | 210 | ||
| 211 | --bug report follows this line-- | 211 | --bug report follows this line-- |
| 212 | ")))) | 212 | "))))) |
| 213 | 213 | ||
| 214 | (defun tramp-reporter-dump-variable (varsym mailbuf) | 214 | (defun tramp-reporter-dump-variable (varsym mailbuf) |
| 215 | "Pretty-print the value of the variable in symbol VARSYM." | 215 | "Pretty-print the value of the variable in symbol VARSYM." |
| @@ -348,10 +348,10 @@ the debug buffer(s).") | |||
| 348 | (kill-buffer nil) | 348 | (kill-buffer nil) |
| 349 | (switch-to-buffer curbuf) | 349 | (switch-to-buffer curbuf) |
| 350 | (goto-char (point-max)) | 350 | (goto-char (point-max)) |
| 351 | (insert "\n\ | 351 | (insert (propertize "\n" 'display "\n\ |
| 352 | This is a special notion of the `gnus/message' package. If you | 352 | This is a special notion of the `gnus/message' package. If you |
| 353 | use another mail agent (by copying the contents of this buffer) | 353 | use another mail agent (by copying the contents of this buffer) |
| 354 | please ensure that the buffers are attached to your email.\n\n") | 354 | please ensure that the buffers are attached to your email.\n\n")) |
| 355 | (dolist (buffer buffer-list) | 355 | (dolist (buffer buffer-list) |
| 356 | (tramp-compat-funcall | 356 | (tramp-compat-funcall |
| 357 | 'mml-insert-empty-tag 'part 'type "text/plain" | 357 | 'mml-insert-empty-tag 'part 'type "text/plain" |
diff --git a/src/ChangeLog b/src/ChangeLog index ca37bb3ea56..7dc7b25f85a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,35 @@ | |||
| 1 | 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * window.h (struct window): Change window_end_valid member from | ||
| 4 | Lisp_Object to a bitfield. Adjust comments. | ||
| 5 | (wset_window_end_valid): Remove. | ||
| 6 | * window.c (adjust_window_count): Clear window_end_valid. | ||
| 7 | (Fwindow_end): Adjust user. Remove ancient #if 0 code. | ||
| 8 | (Fwindow_line_height, set_window_buffer, Frecenter) | ||
| 9 | (Fsplit_window_internal, Fdelete_other_windows_internal) | ||
| 10 | (Fset_window_fringes, Fset_window_scroll_bars): Adjust users. | ||
| 11 | * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise. | ||
| 12 | * xdisp.c (check_window_end, reconsider_clip_changes) | ||
| 13 | (redisplay_internal, mark_window_display_accurate_1, redisplay_window) | ||
| 14 | (try_window, try_window_reusing_current_matrix, note_mouse_highlight) | ||
| 15 | (find_first_unchanged_at_end_row, try_window_id): Likewise. | ||
| 16 | |||
| 17 | 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 18 | |||
| 19 | * xdisp.c (mark_window_display_accurate): Simplify the loop | ||
| 20 | assuming that the only one of vchild, hchild or buffer window | ||
| 21 | slots is non-nil. Call mark_window_display_accurate_1 for | ||
| 22 | the leaf windows only. | ||
| 23 | (mark_window_display_accurate_1): Always assume leaf window. | ||
| 24 | Adjust comment. | ||
| 25 | |||
| 26 | 2013-01-22 Paul Eggert <eggert@cs.ucla.edu> | ||
| 27 | |||
| 28 | * emacs.c (Qkill_emacs_hook): Now static. | ||
| 29 | |||
| 30 | * fileio.c (Finsert_file_contents): Simplify. | ||
| 31 | Remove unnecessary assignments and tests. | ||
| 32 | |||
| 1 | 2013-01-21 Eli Zaretskii <eliz@gnu.org> | 33 | 2013-01-21 Eli Zaretskii <eliz@gnu.org> |
| 2 | 34 | ||
| 3 | * w32.c (acl_set_file): Don't test for errors unless | 35 | * w32.c (acl_set_file): Don't test for errors unless |
diff --git a/src/dispnew.c b/src/dispnew.c index 144fa659c47..32ac606b84e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -609,7 +609,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y | |||
| 609 | are invalidated below. */ | 609 | are invalidated below. */ |
| 610 | if (INTEGERP (w->window_end_vpos) | 610 | if (INTEGERP (w->window_end_vpos) |
| 611 | && XFASTINT (w->window_end_vpos) >= i) | 611 | && XFASTINT (w->window_end_vpos) >= i) |
| 612 | wset_window_end_valid (w, Qnil); | 612 | w->window_end_valid = 0; |
| 613 | 613 | ||
| 614 | while (i < matrix->nrows) | 614 | while (i < matrix->nrows) |
| 615 | matrix->rows[i++].enabled_p = 0; | 615 | matrix->rows[i++].enabled_p = 0; |
| @@ -864,7 +864,7 @@ clear_window_matrices (struct window *w, bool desired_p) | |||
| 864 | else | 864 | else |
| 865 | { | 865 | { |
| 866 | clear_glyph_matrix (w->current_matrix); | 866 | clear_glyph_matrix (w->current_matrix); |
| 867 | wset_window_end_valid (w, Qnil); | 867 | w->window_end_valid = 0; |
| 868 | } | 868 | } |
| 869 | } | 869 | } |
| 870 | 870 | ||
diff --git a/src/emacs.c b/src/emacs.c index 564084ec610..21c7a7cec03 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -136,7 +136,8 @@ Lisp_Object Qfile_name_handler_alist; | |||
| 136 | 136 | ||
| 137 | Lisp_Object Qrisky_local_variable; | 137 | Lisp_Object Qrisky_local_variable; |
| 138 | 138 | ||
| 139 | Lisp_Object Qkill_emacs, Qkill_emacs_hook; | 139 | Lisp_Object Qkill_emacs; |
| 140 | static Lisp_Object Qkill_emacs_hook; | ||
| 140 | 141 | ||
| 141 | /* If true, Emacs should not attempt to use a window-specific code, | 142 | /* If true, Emacs should not attempt to use a window-specific code, |
| 142 | but instead should use the virtual terminal under which it was started. */ | 143 | but instead should use the virtual terminal under which it was started. */ |
diff --git a/src/fileio.c b/src/fileio.c index 175f363ec92..a826ac1f94a 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3573,7 +3573,6 @@ by calling `format-decode', which see. */) | |||
| 3573 | report_file_error ("Opening input file", Fcons (orig_filename, Qnil)); | 3573 | report_file_error ("Opening input file", Fcons (orig_filename, Qnil)); |
| 3574 | mtime = time_error_value (save_errno); | 3574 | mtime = time_error_value (save_errno); |
| 3575 | st.st_size = -1; | 3575 | st.st_size = -1; |
| 3576 | how_much = 0; | ||
| 3577 | if (!NILP (Vcoding_system_for_read)) | 3576 | if (!NILP (Vcoding_system_for_read)) |
| 3578 | Fset (Qbuffer_file_coding_system, Vcoding_system_for_read); | 3577 | Fset (Qbuffer_file_coding_system, Vcoding_system_for_read); |
| 3579 | goto notfound; | 3578 | goto notfound; |
| @@ -4008,30 +4007,25 @@ by calling `format-decode', which see. */) | |||
| 4008 | report_file_error ("Setting file position", | 4007 | report_file_error ("Setting file position", |
| 4009 | Fcons (orig_filename, Qnil)); | 4008 | Fcons (orig_filename, Qnil)); |
| 4010 | 4009 | ||
| 4011 | total = st.st_size; /* Total bytes in the file. */ | ||
| 4012 | how_much = 0; /* Bytes read from file so far. */ | ||
| 4013 | inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */ | 4010 | inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */ |
| 4014 | unprocessed = 0; /* Bytes not processed in previous loop. */ | 4011 | unprocessed = 0; /* Bytes not processed in previous loop. */ |
| 4015 | 4012 | ||
| 4016 | GCPRO1 (conversion_buffer); | 4013 | GCPRO1 (conversion_buffer); |
| 4017 | while (how_much < total) | 4014 | while (1) |
| 4018 | { | 4015 | { |
| 4019 | /* We read one bunch by one (READ_BUF_SIZE bytes) to allow | 4016 | /* Read at most READ_BUF_SIZE bytes at a time, to allow |
| 4020 | quitting while reading a huge while. */ | 4017 | quitting while reading a huge file. */ |
| 4021 | /* `try'' is reserved in some compilers (Microsoft C). */ | ||
| 4022 | int trytry = min (total - how_much, READ_BUF_SIZE - unprocessed); | ||
| 4023 | 4018 | ||
| 4024 | /* Allow quitting out of the actual I/O. */ | 4019 | /* Allow quitting out of the actual I/O. */ |
| 4025 | immediate_quit = 1; | 4020 | immediate_quit = 1; |
| 4026 | QUIT; | 4021 | QUIT; |
| 4027 | this = emacs_read (fd, read_buf + unprocessed, trytry); | 4022 | this = emacs_read (fd, read_buf + unprocessed, |
| 4023 | READ_BUF_SIZE - unprocessed); | ||
| 4028 | immediate_quit = 0; | 4024 | immediate_quit = 0; |
| 4029 | 4025 | ||
| 4030 | if (this <= 0) | 4026 | if (this <= 0) |
| 4031 | break; | 4027 | break; |
| 4032 | 4028 | ||
| 4033 | how_much += this; | ||
| 4034 | |||
| 4035 | BUF_TEMP_SET_PT (XBUFFER (conversion_buffer), | 4029 | BUF_TEMP_SET_PT (XBUFFER (conversion_buffer), |
| 4036 | BUF_Z (XBUFFER (conversion_buffer))); | 4030 | BUF_Z (XBUFFER (conversion_buffer))); |
| 4037 | decode_coding_c_string (&coding, (unsigned char *) read_buf, | 4031 | decode_coding_c_string (&coding, (unsigned char *) read_buf, |
| @@ -4048,9 +4042,6 @@ by calling `format-decode', which see. */) | |||
| 4048 | so defer the removal till we reach the `handled' label. */ | 4042 | so defer the removal till we reach the `handled' label. */ |
| 4049 | deferred_remove_unwind_protect = 1; | 4043 | deferred_remove_unwind_protect = 1; |
| 4050 | 4044 | ||
| 4051 | /* At this point, HOW_MUCH should equal TOTAL, or should be <= 0 | ||
| 4052 | if we couldn't read the file. */ | ||
| 4053 | |||
| 4054 | if (this < 0) | 4045 | if (this < 0) |
| 4055 | error ("IO error reading %s: %s", | 4046 | error ("IO error reading %s: %s", |
| 4056 | SDATA (orig_filename), emacs_strerror (errno)); | 4047 | SDATA (orig_filename), emacs_strerror (errno)); |
diff --git a/src/window.c b/src/window.c index d38f4c10671..906cfe6ba9d 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -287,6 +287,8 @@ adjust_window_count (struct window *w, int arg) | |||
| 287 | b = b->base_buffer; | 287 | b = b->base_buffer; |
| 288 | b->window_count += arg; | 288 | b->window_count += arg; |
| 289 | eassert (b->window_count >= 0); | 289 | eassert (b->window_count >= 0); |
| 290 | /* Catch redisplay's attention. */ | ||
| 291 | w->window_end_valid = 0; | ||
| 290 | } | 292 | } |
| 291 | } | 293 | } |
| 292 | 294 | ||
| @@ -1490,17 +1492,8 @@ if it isn't already recorded. */) | |||
| 1490 | CHECK_BUFFER (buf); | 1492 | CHECK_BUFFER (buf); |
| 1491 | b = XBUFFER (buf); | 1493 | b = XBUFFER (buf); |
| 1492 | 1494 | ||
| 1493 | #if 0 /* This change broke some things. We should make it later. */ | ||
| 1494 | /* If we don't know the end position, return nil. | ||
| 1495 | The user can compute it with vertical-motion if he wants to. | ||
| 1496 | It would be nicer to do it automatically, | ||
| 1497 | but that's so slow that it would probably bother people. */ | ||
| 1498 | if (NILP (w->window_end_valid)) | ||
| 1499 | return Qnil; | ||
| 1500 | #endif | ||
| 1501 | |||
| 1502 | if (! NILP (update) | 1495 | if (! NILP (update) |
| 1503 | && (windows_or_buffers_changed || NILP (w->window_end_valid)) | 1496 | && (windows_or_buffers_changed || !w->window_end_valid) |
| 1504 | && !noninteractive) | 1497 | && !noninteractive) |
| 1505 | { | 1498 | { |
| 1506 | struct text_pos startp; | 1499 | struct text_pos startp; |
| @@ -1707,7 +1700,7 @@ Return nil if window display is not up-to-date. In that case, use | |||
| 1707 | b = XBUFFER (w->buffer); | 1700 | b = XBUFFER (w->buffer); |
| 1708 | 1701 | ||
| 1709 | /* Fail if current matrix is not up-to-date. */ | 1702 | /* Fail if current matrix is not up-to-date. */ |
| 1710 | if (NILP (w->window_end_valid) | 1703 | if (!w->window_end_valid |
| 1711 | || current_buffer->clip_changed | 1704 | || current_buffer->clip_changed |
| 1712 | || current_buffer->prevent_redisplay_optimizations_p | 1705 | || current_buffer->prevent_redisplay_optimizations_p |
| 1713 | || w->last_modified < BUF_MODIFF (b) | 1706 | || w->last_modified < BUF_MODIFF (b) |
| @@ -2039,7 +2032,7 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag) | |||
| 2039 | n->pseudo_window_p = 0; | 2032 | n->pseudo_window_p = 0; |
| 2040 | wset_window_end_vpos (n, make_number (0)); | 2033 | wset_window_end_vpos (n, make_number (0)); |
| 2041 | wset_window_end_pos (n, make_number (0)); | 2034 | wset_window_end_pos (n, make_number (0)); |
| 2042 | wset_window_end_valid (n, Qnil); | 2035 | n->window_end_valid = 0; |
| 2043 | n->frozen_window_start_p = 0; | 2036 | n->frozen_window_start_p = 0; |
| 2044 | } | 2037 | } |
| 2045 | 2038 | ||
| @@ -2974,7 +2967,7 @@ window-start value is reasonable when this function is called. */) | |||
| 2974 | pos = *vmotion (startpos, -top, w); | 2967 | pos = *vmotion (startpos, -top, w); |
| 2975 | 2968 | ||
| 2976 | set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); | 2969 | set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); |
| 2977 | wset_window_end_valid (w, Qnil); | 2970 | w->window_end_valid = 0; |
| 2978 | w->start_at_line_beg = (pos.bytepos == BEGV_BYTE | 2971 | w->start_at_line_beg = (pos.bytepos == BEGV_BYTE |
| 2979 | || FETCH_BYTE (pos.bytepos - 1) == '\n'); | 2972 | || FETCH_BYTE (pos.bytepos - 1) == '\n'); |
| 2980 | /* We need to do this, so that the window-scroll-functions | 2973 | /* We need to do this, so that the window-scroll-functions |
| @@ -3190,7 +3183,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int | |||
| 3190 | wset_window_end_pos (w, make_number (0)); | 3183 | wset_window_end_pos (w, make_number (0)); |
| 3191 | wset_window_end_vpos (w, make_number (0)); | 3184 | wset_window_end_vpos (w, make_number (0)); |
| 3192 | memset (&w->last_cursor, 0, sizeof w->last_cursor); | 3185 | memset (&w->last_cursor, 0, sizeof w->last_cursor); |
| 3193 | wset_window_end_valid (w, Qnil); | 3186 | |
| 3194 | if (!(keep_margins_p && samebuf)) | 3187 | if (!(keep_margins_p && samebuf)) |
| 3195 | { /* If we're not actually changing the buffer, don't reset hscroll and | 3188 | { /* If we're not actually changing the buffer, don't reset hscroll and |
| 3196 | vscroll. This case happens for example when called from | 3189 | vscroll. This case happens for example when called from |
| @@ -3959,7 +3952,7 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3959 | wset_next (o, new); | 3952 | wset_next (o, new); |
| 3960 | } | 3953 | } |
| 3961 | 3954 | ||
| 3962 | wset_window_end_valid (n, Qnil); | 3955 | n->window_end_valid = 0; |
| 3963 | memset (&n->last_cursor, 0, sizeof n->last_cursor); | 3956 | memset (&n->last_cursor, 0, sizeof n->last_cursor); |
| 3964 | 3957 | ||
| 3965 | /* Get special geometry settings from reference window. */ | 3958 | /* Get special geometry settings from reference window. */ |
| @@ -5372,7 +5365,7 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5372 | 5365 | ||
| 5373 | /* Set the new window start. */ | 5366 | /* Set the new window start. */ |
| 5374 | set_marker_both (w->start, w->buffer, charpos, bytepos); | 5367 | set_marker_both (w->start, w->buffer, charpos, bytepos); |
| 5375 | wset_window_end_valid (w, Qnil); | 5368 | w->window_end_valid = 0; |
| 5376 | 5369 | ||
| 5377 | w->optional_new_start = 1; | 5370 | w->optional_new_start = 1; |
| 5378 | 5371 | ||
| @@ -6323,7 +6316,7 @@ display marginal areas and the text area. */) | |||
| 6323 | adjust_window_margins (w); | 6316 | adjust_window_margins (w); |
| 6324 | 6317 | ||
| 6325 | clear_glyph_matrix (w->current_matrix); | 6318 | clear_glyph_matrix (w->current_matrix); |
| 6326 | wset_window_end_valid (w, Qnil); | 6319 | w->window_end_valid = 0; |
| 6327 | 6320 | ||
| 6328 | ++windows_or_buffers_changed; | 6321 | ++windows_or_buffers_changed; |
| 6329 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); | 6322 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); |
| @@ -6393,7 +6386,7 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */) | |||
| 6393 | adjust_window_margins (w); | 6386 | adjust_window_margins (w); |
| 6394 | 6387 | ||
| 6395 | clear_glyph_matrix (w->current_matrix); | 6388 | clear_glyph_matrix (w->current_matrix); |
| 6396 | wset_window_end_valid (w, Qnil); | 6389 | w->window_end_valid = 0; |
| 6397 | 6390 | ||
| 6398 | ++windows_or_buffers_changed; | 6391 | ++windows_or_buffers_changed; |
| 6399 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); | 6392 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); |
diff --git a/src/window.h b/src/window.h index 1ebd35a7c64..135f591ded7 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -175,17 +175,13 @@ struct window | |||
| 175 | no scroll bar. A value of t means use frame value. */ | 175 | no scroll bar. A value of t means use frame value. */ |
| 176 | Lisp_Object vertical_scroll_bar_type; | 176 | Lisp_Object vertical_scroll_bar_type; |
| 177 | 177 | ||
| 178 | /* Z - the buffer position of the last glyph in the current matrix | 178 | /* Z - the buffer position of the last glyph in the current |
| 179 | of W. Only valid if WINDOW_END_VALID is not nil. */ | 179 | matrix of W. Only valid if window_end_valid is nonzero. */ |
| 180 | Lisp_Object window_end_pos; | 180 | Lisp_Object window_end_pos; |
| 181 | |||
| 181 | /* Glyph matrix row of the last glyph in the current matrix | 182 | /* Glyph matrix row of the last glyph in the current matrix |
| 182 | of W. Only valid if WINDOW_END_VALID is not nil. */ | 183 | of W. Only valid if window_end_valid is nonzero. */ |
| 183 | Lisp_Object window_end_vpos; | 184 | Lisp_Object window_end_vpos; |
| 184 | /* t if window_end_pos is truly valid. | ||
| 185 | This is nil if nontrivial redisplay is preempted | ||
| 186 | since in that case the frame image that window_end_pos | ||
| 187 | did not get onto the frame. */ | ||
| 188 | Lisp_Object window_end_valid; | ||
| 189 | 185 | ||
| 190 | /* Display-table to use for displaying chars in this window. | 186 | /* Display-table to use for displaying chars in this window. |
| 191 | Nil means use the buffer's own display-table. */ | 187 | Nil means use the buffer's own display-table. */ |
| @@ -339,12 +335,17 @@ struct window | |||
| 339 | Otherwise draw them between margin areas and text. */ | 335 | Otherwise draw them between margin areas and text. */ |
| 340 | unsigned fringes_outside_margins : 1; | 336 | unsigned fringes_outside_margins : 1; |
| 341 | 337 | ||
| 338 | /* Nonzero if window_end_pos and window_end_vpos are truly valid. | ||
| 339 | This is zero if nontrivial redisplay is preempted since in that case | ||
| 340 | the frame image that window_end_pos did not get onto the frame. */ | ||
| 341 | unsigned window_end_valid : 1; | ||
| 342 | |||
| 342 | /* Amount by which lines of this window are scrolled in | 343 | /* Amount by which lines of this window are scrolled in |
| 343 | y-direction (smooth scrolling). */ | 344 | y-direction (smooth scrolling). */ |
| 344 | int vscroll; | 345 | int vscroll; |
| 345 | 346 | ||
| 346 | /* Z_BYTE - Buffer position of the last glyph in the current matrix of W. | 347 | /* Z_BYTE - buffer position of the last glyph in the current matrix of W. |
| 347 | Should be nonnegative, and only valid if window_end_valid is not nil. */ | 348 | Should be nonnegative, and only valid if window_end_valid is nonzero. */ |
| 348 | ptrdiff_t window_end_bytepos; | 349 | ptrdiff_t window_end_bytepos; |
| 349 | }; | 350 | }; |
| 350 | 351 | ||
| @@ -401,11 +402,6 @@ wset_window_end_pos (struct window *w, Lisp_Object val) | |||
| 401 | w->window_end_pos = val; | 402 | w->window_end_pos = val; |
| 402 | } | 403 | } |
| 403 | WINDOW_INLINE void | 404 | WINDOW_INLINE void |
| 404 | wset_window_end_valid (struct window *w, Lisp_Object val) | ||
| 405 | { | ||
| 406 | w->window_end_valid = val; | ||
| 407 | } | ||
| 408 | WINDOW_INLINE void | ||
| 409 | wset_window_end_vpos (struct window *w, Lisp_Object val) | 405 | wset_window_end_vpos (struct window *w, Lisp_Object val) |
| 410 | { | 406 | { |
| 411 | w->window_end_vpos = val; | 407 | w->window_end_vpos = val; |
diff --git a/src/xdisp.c b/src/xdisp.c index 880e25334d1..12efe3c5396 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -2544,8 +2544,7 @@ check_it (struct it *it) | |||
| 2544 | static void | 2544 | static void |
| 2545 | check_window_end (struct window *w) | 2545 | check_window_end (struct window *w) |
| 2546 | { | 2546 | { |
| 2547 | if (!MINI_WINDOW_P (w) | 2547 | if (!MINI_WINDOW_P (w) && w->window_end_valid) |
| 2548 | && !NILP (w->window_end_valid)) | ||
| 2549 | { | 2548 | { |
| 2550 | struct glyph_row *row; | 2549 | struct glyph_row *row; |
| 2551 | eassert ((row = MATRIX_ROW (w->current_matrix, | 2550 | eassert ((row = MATRIX_ROW (w->current_matrix, |
| @@ -12976,10 +12975,10 @@ static void | |||
| 12976 | reconsider_clip_changes (struct window *w, struct buffer *b) | 12975 | reconsider_clip_changes (struct window *w, struct buffer *b) |
| 12977 | { | 12976 | { |
| 12978 | if (b->clip_changed | 12977 | if (b->clip_changed |
| 12979 | && !NILP (w->window_end_valid) | 12978 | && w->window_end_valid |
| 12980 | && w->current_matrix->buffer == b | 12979 | && w->current_matrix->buffer == b |
| 12981 | && w->current_matrix->zv == BUF_ZV (b) | 12980 | && w->current_matrix->zv == BUF_ZV (b) |
| 12982 | && w->current_matrix->begv == BUF_BEGV (b)) | 12981 | && w->current_matrix->begv == BUF_BEGV (b)) |
| 12983 | b->clip_changed = 0; | 12982 | b->clip_changed = 0; |
| 12984 | 12983 | ||
| 12985 | /* If display wasn't paused, and W is not a tool bar window, see if | 12984 | /* If display wasn't paused, and W is not a tool bar window, see if |
| @@ -12987,8 +12986,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b) | |||
| 12987 | we set b->clip_changed to 1 to force updating the screen. If | 12986 | we set b->clip_changed to 1 to force updating the screen. If |
| 12988 | b->clip_changed has already been set to 1, we can skip this | 12987 | b->clip_changed has already been set to 1, we can skip this |
| 12989 | check. */ | 12988 | check. */ |
| 12990 | if (!b->clip_changed | 12989 | if (!b->clip_changed && BUFFERP (w->buffer) && w->window_end_valid) |
| 12991 | && BUFFERP (w->buffer) && !NILP (w->window_end_valid)) | ||
| 12992 | { | 12990 | { |
| 12993 | ptrdiff_t pt; | 12991 | ptrdiff_t pt; |
| 12994 | 12992 | ||
| @@ -13382,7 +13380,7 @@ redisplay_internal (void) | |||
| 13382 | else if (XFASTINT (w->window_end_vpos) == this_line_vpos | 13380 | else if (XFASTINT (w->window_end_vpos) == this_line_vpos |
| 13383 | && this_line_vpos > 0) | 13381 | && this_line_vpos > 0) |
| 13384 | wset_window_end_vpos (w, make_number (this_line_vpos - 1)); | 13382 | wset_window_end_vpos (w, make_number (this_line_vpos - 1)); |
| 13385 | wset_window_end_valid (w, Qnil); | 13383 | w->window_end_valid = 0; |
| 13386 | 13384 | ||
| 13387 | /* Update hint: No need to try to scroll in update_window. */ | 13385 | /* Update hint: No need to try to scroll in update_window. */ |
| 13388 | w->desired_matrix->no_scrolling_p = 1; | 13386 | w->desired_matrix->no_scrolling_p = 1; |
| @@ -13783,50 +13781,43 @@ unwind_redisplay (Lisp_Object old_frame) | |||
| 13783 | } | 13781 | } |
| 13784 | 13782 | ||
| 13785 | 13783 | ||
| 13786 | /* Mark the display of window W as accurate or inaccurate. If | 13784 | /* Mark the display of leaf window W as accurate or inaccurate. |
| 13787 | ACCURATE_P is non-zero mark display of W as accurate. If | 13785 | If ACCURATE_P is non-zero mark display of W as accurate. If |
| 13788 | ACCURATE_P is zero, arrange for W to be redisplayed the next time | 13786 | ACCURATE_P is zero, arrange for W to be redisplayed the next |
| 13789 | redisplay_internal is called. */ | 13787 | time redisplay_internal is called. */ |
| 13790 | 13788 | ||
| 13791 | static void | 13789 | static void |
| 13792 | mark_window_display_accurate_1 (struct window *w, int accurate_p) | 13790 | mark_window_display_accurate_1 (struct window *w, int accurate_p) |
| 13793 | { | 13791 | { |
| 13794 | if (BUFFERP (w->buffer)) | 13792 | struct buffer *b = XBUFFER (w->buffer); |
| 13795 | { | ||
| 13796 | struct buffer *b = XBUFFER (w->buffer); | ||
| 13797 | 13793 | ||
| 13798 | w->last_modified = accurate_p ? BUF_MODIFF (b) : 0; | 13794 | w->last_modified = accurate_p ? BUF_MODIFF (b) : 0; |
| 13799 | w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF (b) : 0; | 13795 | w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF (b) : 0; |
| 13800 | w->last_had_star | 13796 | w->last_had_star = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b); |
| 13801 | = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b); | ||
| 13802 | 13797 | ||
| 13803 | if (accurate_p) | 13798 | if (accurate_p) |
| 13804 | { | 13799 | { |
| 13805 | b->clip_changed = 0; | 13800 | b->clip_changed = 0; |
| 13806 | b->prevent_redisplay_optimizations_p = 0; | 13801 | b->prevent_redisplay_optimizations_p = 0; |
| 13807 | 13802 | ||
| 13808 | BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); | 13803 | BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); |
| 13809 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); | 13804 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); |
| 13810 | BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); | 13805 | BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); |
| 13811 | BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); | 13806 | BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); |
| 13812 | 13807 | ||
| 13813 | w->current_matrix->buffer = b; | 13808 | w->current_matrix->buffer = b; |
| 13814 | w->current_matrix->begv = BUF_BEGV (b); | 13809 | w->current_matrix->begv = BUF_BEGV (b); |
| 13815 | w->current_matrix->zv = BUF_ZV (b); | 13810 | w->current_matrix->zv = BUF_ZV (b); |
| 13816 | 13811 | ||
| 13817 | w->last_cursor = w->cursor; | 13812 | w->last_cursor = w->cursor; |
| 13818 | w->last_cursor_off_p = w->cursor_off_p; | 13813 | w->last_cursor_off_p = w->cursor_off_p; |
| 13819 | 13814 | ||
| 13820 | if (w == XWINDOW (selected_window)) | 13815 | if (w == XWINDOW (selected_window)) |
| 13821 | w->last_point = BUF_PT (b); | 13816 | w->last_point = BUF_PT (b); |
| 13822 | else | 13817 | else |
| 13823 | w->last_point = marker_position (w->pointm); | 13818 | w->last_point = marker_position (w->pointm); |
| 13824 | } | ||
| 13825 | } | ||
| 13826 | 13819 | ||
| 13827 | if (accurate_p) | 13820 | w->window_end_valid = 1; |
| 13828 | { | ||
| 13829 | wset_window_end_valid (w, w->buffer); | ||
| 13830 | w->update_mode_line = 0; | 13821 | w->update_mode_line = 0; |
| 13831 | } | 13822 | } |
| 13832 | } | 13823 | } |
| @@ -13845,25 +13836,21 @@ mark_window_display_accurate (Lisp_Object window, int accurate_p) | |||
| 13845 | for (; !NILP (window); window = w->next) | 13836 | for (; !NILP (window); window = w->next) |
| 13846 | { | 13837 | { |
| 13847 | w = XWINDOW (window); | 13838 | w = XWINDOW (window); |
| 13848 | mark_window_display_accurate_1 (w, accurate_p); | ||
| 13849 | |||
| 13850 | if (!NILP (w->vchild)) | 13839 | if (!NILP (w->vchild)) |
| 13851 | mark_window_display_accurate (w->vchild, accurate_p); | 13840 | mark_window_display_accurate (w->vchild, accurate_p); |
| 13852 | if (!NILP (w->hchild)) | 13841 | else if (!NILP (w->hchild)) |
| 13853 | mark_window_display_accurate (w->hchild, accurate_p); | 13842 | mark_window_display_accurate (w->hchild, accurate_p); |
| 13843 | else if (BUFFERP (w->buffer)) | ||
| 13844 | mark_window_display_accurate_1 (w, accurate_p); | ||
| 13854 | } | 13845 | } |
| 13855 | 13846 | ||
| 13856 | if (accurate_p) | 13847 | if (accurate_p) |
| 13857 | { | 13848 | update_overlay_arrows (1); |
| 13858 | update_overlay_arrows (1); | ||
| 13859 | } | ||
| 13860 | else | 13849 | else |
| 13861 | { | 13850 | /* Force a thorough redisplay the next time by setting |
| 13862 | /* Force a thorough redisplay the next time by setting | 13851 | last_arrow_position and last_arrow_string to t, which is |
| 13863 | last_arrow_position and last_arrow_string to t, which is | 13852 | unequal to any useful value of Voverlay_arrow_... */ |
| 13864 | unequal to any useful value of Voverlay_arrow_... */ | 13853 | update_overlay_arrows (-1); |
| 13865 | update_overlay_arrows (-1); | ||
| 13866 | } | ||
| 13867 | } | 13854 | } |
| 13868 | 13855 | ||
| 13869 | 13856 | ||
| @@ -15532,7 +15519,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15532 | set_buffer_internal_1 (XBUFFER (w->buffer)); | 15519 | set_buffer_internal_1 (XBUFFER (w->buffer)); |
| 15533 | 15520 | ||
| 15534 | current_matrix_up_to_date_p | 15521 | current_matrix_up_to_date_p |
| 15535 | = (!NILP (w->window_end_valid) | 15522 | = (w->window_end_valid |
| 15536 | && !current_buffer->clip_changed | 15523 | && !current_buffer->clip_changed |
| 15537 | && !current_buffer->prevent_redisplay_optimizations_p | 15524 | && !current_buffer->prevent_redisplay_optimizations_p |
| 15538 | && !window_outdated (w)); | 15525 | && !window_outdated (w)); |
| @@ -15555,7 +15542,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15555 | specbind (Qinhibit_point_motion_hooks, Qt); | 15542 | specbind (Qinhibit_point_motion_hooks, Qt); |
| 15556 | 15543 | ||
| 15557 | buffer_unchanged_p | 15544 | buffer_unchanged_p |
| 15558 | = (!NILP (w->window_end_valid) | 15545 | = (w->window_end_valid |
| 15559 | && !current_buffer->clip_changed | 15546 | && !current_buffer->clip_changed |
| 15560 | && !window_outdated (w)); | 15547 | && !window_outdated (w)); |
| 15561 | 15548 | ||
| @@ -15568,7 +15555,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15568 | if (XMARKER (w->start)->buffer == current_buffer) | 15555 | if (XMARKER (w->start)->buffer == current_buffer) |
| 15569 | compute_window_start_on_continuation_line (w); | 15556 | compute_window_start_on_continuation_line (w); |
| 15570 | 15557 | ||
| 15571 | wset_window_end_valid (w, Qnil); | 15558 | w->window_end_valid = 0; |
| 15572 | } | 15559 | } |
| 15573 | 15560 | ||
| 15574 | /* Some sanity checks. */ | 15561 | /* Some sanity checks. */ |
| @@ -15657,7 +15644,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15657 | 15644 | ||
| 15658 | w->force_start = 0; | 15645 | w->force_start = 0; |
| 15659 | w->vscroll = 0; | 15646 | w->vscroll = 0; |
| 15660 | wset_window_end_valid (w, Qnil); | 15647 | w->window_end_valid = 0; |
| 15661 | 15648 | ||
| 15662 | /* Forget any recorded base line for line number display. */ | 15649 | /* Forget any recorded base line for line number display. */ |
| 15663 | if (!buffer_unchanged_p) | 15650 | if (!buffer_unchanged_p) |
| @@ -16106,8 +16093,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 16106 | line.) */ | 16093 | line.) */ |
| 16107 | if (w->cursor.vpos < 0) | 16094 | if (w->cursor.vpos < 0) |
| 16108 | { | 16095 | { |
| 16109 | if (!NILP (w->window_end_valid) | 16096 | if (w->window_end_valid && PT >= Z - XFASTINT (w->window_end_pos)) |
| 16110 | && PT >= Z - XFASTINT (w->window_end_pos)) | ||
| 16111 | { | 16097 | { |
| 16112 | clear_glyph_matrix (w->desired_matrix); | 16098 | clear_glyph_matrix (w->desired_matrix); |
| 16113 | move_it_by_lines (&it, 1); | 16099 | move_it_by_lines (&it, 1); |
| @@ -16431,7 +16417,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags) | |||
| 16431 | } | 16417 | } |
| 16432 | 16418 | ||
| 16433 | /* But that is not valid info until redisplay finishes. */ | 16419 | /* But that is not valid info until redisplay finishes. */ |
| 16434 | wset_window_end_valid (w, Qnil); | 16420 | w->window_end_valid = 0; |
| 16435 | return 1; | 16421 | return 1; |
| 16436 | } | 16422 | } |
| 16437 | 16423 | ||
| @@ -16685,7 +16671,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 16685 | wset_window_end_pos (w, make_number (Z - ZV)); | 16671 | wset_window_end_pos (w, make_number (Z - ZV)); |
| 16686 | wset_window_end_vpos (w, make_number (0)); | 16672 | wset_window_end_vpos (w, make_number (0)); |
| 16687 | } | 16673 | } |
| 16688 | wset_window_end_valid (w, Qnil); | 16674 | w->window_end_valid = 0; |
| 16689 | 16675 | ||
| 16690 | /* Update hint: don't try scrolling again in update_window. */ | 16676 | /* Update hint: don't try scrolling again in update_window. */ |
| 16691 | w->desired_matrix->no_scrolling_p = 1; | 16677 | w->desired_matrix->no_scrolling_p = 1; |
| @@ -16883,7 +16869,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 16883 | (w, make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled)); | 16869 | (w, make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled)); |
| 16884 | } | 16870 | } |
| 16885 | 16871 | ||
| 16886 | wset_window_end_valid (w, Qnil); | 16872 | w->window_end_valid = 0; |
| 16887 | w->desired_matrix->no_scrolling_p = 1; | 16873 | w->desired_matrix->no_scrolling_p = 1; |
| 16888 | 16874 | ||
| 16889 | #ifdef GLYPH_DEBUG | 16875 | #ifdef GLYPH_DEBUG |
| @@ -17016,7 +17002,7 @@ find_first_unchanged_at_end_row (struct window *w, | |||
| 17016 | 17002 | ||
| 17017 | /* Display must not have been paused, otherwise the current matrix | 17003 | /* Display must not have been paused, otherwise the current matrix |
| 17018 | is not up to date. */ | 17004 | is not up to date. */ |
| 17019 | eassert (!NILP (w->window_end_valid)); | 17005 | eassert (w->window_end_valid); |
| 17020 | 17006 | ||
| 17021 | /* A value of window_end_pos >= END_UNCHANGED means that the window | 17007 | /* A value of window_end_pos >= END_UNCHANGED means that the window |
| 17022 | end is in the range of changed text. If so, there is no | 17008 | end is in the range of changed text. If so, there is no |
| @@ -17200,7 +17186,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos, | |||
| 17200 | 17186 | ||
| 17201 | /* Try to redisplay window W by reusing its existing display. W's | 17187 | /* Try to redisplay window W by reusing its existing display. W's |
| 17202 | current matrix must be up to date when this function is called, | 17188 | current matrix must be up to date when this function is called, |
| 17203 | i.e. window_end_valid must not be nil. | 17189 | i.e. window_end_valid must be nonzero. |
| 17204 | 17190 | ||
| 17205 | Value is | 17191 | Value is |
| 17206 | 17192 | ||
| @@ -17315,7 +17301,7 @@ try_window_id (struct window *w) | |||
| 17315 | GIVE_UP (7); | 17301 | GIVE_UP (7); |
| 17316 | 17302 | ||
| 17317 | /* Verify that display wasn't paused. */ | 17303 | /* Verify that display wasn't paused. */ |
| 17318 | if (NILP (w->window_end_valid)) | 17304 | if (!w->window_end_valid) |
| 17319 | GIVE_UP (8); | 17305 | GIVE_UP (8); |
| 17320 | 17306 | ||
| 17321 | /* Can't use this if highlighting a region because a cursor movement | 17307 | /* Can't use this if highlighting a region because a cursor movement |
| @@ -17966,7 +17952,7 @@ try_window_id (struct window *w) | |||
| 17966 | debug_end_vpos = XFASTINT (w->window_end_vpos)); | 17952 | debug_end_vpos = XFASTINT (w->window_end_vpos)); |
| 17967 | 17953 | ||
| 17968 | /* Record that display has not been completed. */ | 17954 | /* Record that display has not been completed. */ |
| 17969 | wset_window_end_valid (w, Qnil); | 17955 | w->window_end_valid = 0; |
| 17970 | w->desired_matrix->no_scrolling_p = 1; | 17956 | w->desired_matrix->no_scrolling_p = 1; |
| 17971 | return 3; | 17957 | return 3; |
| 17972 | 17958 | ||
| @@ -28045,7 +28031,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 28045 | And verify the buffer's text has not changed. */ | 28031 | And verify the buffer's text has not changed. */ |
| 28046 | b = XBUFFER (w->buffer); | 28032 | b = XBUFFER (w->buffer); |
| 28047 | if (part == ON_TEXT | 28033 | if (part == ON_TEXT |
| 28048 | && EQ (w->window_end_valid, w->buffer) | 28034 | && w->window_end_valid |
| 28049 | && w->last_modified == BUF_MODIFF (b) | 28035 | && w->last_modified == BUF_MODIFF (b) |
| 28050 | && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b)) | 28036 | && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b)) |
| 28051 | { | 28037 | { |