]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/xdisp.c (redisplay_window): Re-run pre-redisplay-function after we
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Oct 2014 21:48:58 +0000 (17:48 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Oct 2014 21:48:58 +0000 (17:48 -0400)
move point.

src/ChangeLog
src/xdisp.c

index e0e46a63b0b88f49229ae8d806a017f0df2850a9..39e94a85a0ed22e59c771d2d91b19eb3c8806773 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xdisp.c (redisplay_window): Re-run pre-redisplay-function after we
+       move point.
+
 2014-10-20  Glenn Morris  <rgm@gnu.org>
 
        * 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  <eliz@gnu.org>
 
@@ -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  <eliz@gnu.org>
@@ -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.
 
 
        * 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.
 
 
 2014-07-17  Eli Zaretskii  <eliz@gnu.org>
 
-       * 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 <rudalics@gmx.at>.
 
-       * 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
        (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 <rudalics@gmx.at>.
+       row has zero buffer position as their start position.
+       Reported by martin rudalics <rudalics@gmx.at>.
 
 2014-07-16  Eli Zaretskii  <eliz@gnu.org>
 
        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.
 
 
 2014-04-29  Eli Zaretskii  <eliz@gnu.org>
 
-       * 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.
 
index 80d4d52531acc6dbbe32b0a2766e34213c3a5489..7ed115308462a501c31341fa9fad8ef056a1fe52 100644 (file)
@@ -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))
        {