From 290d4b570fb12a5e92c64376f6018637b33e136f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 20 Oct 2014 17:48:58 -0400 Subject: [PATCH] * src/xdisp.c (redisplay_window): Re-run pre-redisplay-function after we move point. --- src/ChangeLog | 42 +++++++++++++++++++++++------------------- src/xdisp.c | 20 ++++++++++++++------ 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e0e46a63b0b..39e94a85a0e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-10-20 Stefan Monnier + + * xdisp.c (redisplay_window): Re-run pre-redisplay-function after we + move point. + 2014-10-20 Glenn Morris * Version 24.4 released. @@ -39,7 +44,7 @@ * xfaces.c (Finternal_set_lisp_face_attribute): Don't try to make a font_object from a tty frame (Bug#18573). - (Finternal_set_lisp_face_attribute): Added FIXME comment. + (Finternal_set_lisp_face_attribute): Add FIXME comment. 2014-09-30 Eli Zaretskii @@ -51,8 +56,8 @@ values. (my_create_window): Move the calculation of the coordinates of the frame's top-left edge here. Pass them to the input thread via the - second parameter of the WM_EMACS_CREATEWINDOW message. See - http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00892.html + second parameter of the WM_EMACS_CREATEWINDOW message. + See http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00892.html for the details. 2014-09-29 Eli Zaretskii @@ -63,8 +68,8 @@ obey it if the glyph row showing point will be fully visible. Likewise when the window start is in a continuation line. If, after trying everything under the 'force_start' label, point is - still not fully visible, give up and scroll the window. Add - debugging traces. (Bug#18545) + still not fully visible, give up and scroll the window. + Add debugging traces. (Bug#18545) * window.c (Frecenter): Set the window's redisplay flag. @@ -244,8 +249,8 @@ * xdisp.c (display_line): Don't assume that the call to reseat_at_next_visible_line_start ends up at a character - immediately following the newline on the previous line. Avoids - setting the ends_at_zv_p flag on screen lines that are not at or + immediately following the newline on the previous line. + Avoids setting the ends_at_zv_p flag on screen lines that are not at or beyond ZV, which causes infloop in redisplay. For the details, see http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00368.html. @@ -364,12 +369,12 @@ 2014-07-17 Eli Zaretskii - * w32select.c (setup_windows_coding_system): Apply - CODING_ANNOTATION_MASK to the common_flags member of struct + * w32select.c (setup_windows_coding_system): + Apply CODING_ANNOTATION_MASK to the common_flags member of struct coding_system. Reported by martin rudalics . - * w16select.c (Fw16_get_clipboard_data): Apply - CODING_ANNOTATION_MASK to the common_flags member of struct + * w16select.c (Fw16_get_clipboard_data): + Apply CODING_ANNOTATION_MASK to the common_flags member of struct coding_system. * xdisp.c (init_iterator): Initialize it->stop_charpos to the @@ -377,8 +382,8 @@ (handle_invisible_prop): Record in it->stop_charpos the position where the invisible text ends. (Bug#18035) (hscroll_window_tree): Don't try hscrolling windows whose cursor - row has zero buffer position as their start position. Reported by - martin rudalics . + row has zero buffer position as their start position. + Reported by martin rudalics . 2014-07-16 Eli Zaretskii @@ -458,8 +463,8 @@ are in sync with what the window wants. (Bug#17892) - * xdisp.c (display_line, display_mode_line): Call - prepare_desired_row with additional arguments, as appropriate. + * xdisp.c (display_line, display_mode_line): + Call prepare_desired_row with additional arguments, as appropriate. * dispextern.h (prepare_desired_row): Adjust prototype. @@ -791,11 +796,10 @@ 2014-04-29 Eli Zaretskii - * term.c (tty_menu_display): Move the cursor to the active menu - item. + * term.c (tty_menu_display): Move the cursor to the active menu item. (tty_menu_activate): Return the cursor to the active menu item - after displaying the menu and after displaying help-echo. See - http://lists.gnu.org/archive/html/emacs-devel/2014-04/msg00402.html + after displaying the menu and after displaying help-echo. + See http://lists.gnu.org/archive/html/emacs-devel/2014-04/msg00402.html for the details of why this is needed by screen readers and Braille displays. diff --git a/src/xdisp.c b/src/xdisp.c index 80d4d52531a..7ed11530846 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -16309,16 +16309,24 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) set_cursor_from_row (w, row, w->desired_matrix, 0, 0, 0, 0); - /* If we are highlighting the region, then we just changed - the region, so redisplay to show it. */ - /* FIXME: We need to (re)run pre-redisplay-function! */ - /* if (markpos_of_region () >= 0) - { + /* Re-run pre-redisplay-function so it can update the region + according to the new position of point. */ + /* Other than the cursor, w's redisplay is done so we can set its + redisplay to false. Also the buffer's redisplay can be set to + false, since propagate_buffer_redisplay should have already + propagated its info to `w' anyway. */ + w->redisplay = false; + XBUFFER (w->contents)->text->redisplay = false; + safe__call1 (true, Vpre_redisplay_function, Fcons (window, Qnil)); + + if (w->redisplay || XBUFFER (w->contents)->text->redisplay) + { + /* pre-redisplay-function made changes (e.g. move the region) + that require another round of redisplay. */ clear_glyph_matrix (w->desired_matrix); if (!try_window (window, startp, 0)) goto need_larger_matrices; } - */ } if (w->cursor.vpos < 0 || !cursor_row_fully_visible_p (w, 0, 0)) { -- 2.39.5