Commit e4e0bee9 authored by Gerd Moellmann's avatar Gerd Moellmann

(direct_output_forward_char): Give up if currently

displaying a message instead of the minibuffer contents.

(row_equal_p): Add parameter MOUSE_FACE_P.  If set,
compare the mouse_face_p flags of both rows.
parent 48b509fe
...@@ -171,7 +171,7 @@ static int update_window P_ ((struct window *, int)); ...@@ -171,7 +171,7 @@ static int update_window P_ ((struct window *, int));
static int update_frame_1 P_ ((struct frame *, int, int)); static int update_frame_1 P_ ((struct frame *, int, int));
static void set_window_cursor_after_update P_ ((struct window *)); static void set_window_cursor_after_update P_ ((struct window *));
static int row_equal_p P_ ((struct window *, struct glyph_row *, static int row_equal_p P_ ((struct window *, struct glyph_row *,
struct glyph_row *)); struct glyph_row *, int));
static void adjust_frame_glyphs_for_window_redisplay P_ ((struct frame *)); static void adjust_frame_glyphs_for_window_redisplay P_ ((struct frame *));
static void adjust_frame_glyphs_for_frame_redisplay P_ ((struct frame *)); static void adjust_frame_glyphs_for_frame_redisplay P_ ((struct frame *));
static void reverse_rows P_ ((struct glyph_matrix *, int, int)); static void reverse_rows P_ ((struct glyph_matrix *, int, int));
...@@ -1348,12 +1348,14 @@ line_draw_cost (matrix, vpos) ...@@ -1348,12 +1348,14 @@ line_draw_cost (matrix, vpos)
/* Test two glyph rows A and B for equality. Value is non-zero if A /* Test two glyph rows A and B for equality. Value is non-zero if A
and B have equal contents. W is the window to which the glyphs and B have equal contents. W is the window to which the glyphs
rows A and B belong. It is needed here to test for partial row rows A and B belong. It is needed here to test for partial row
visibility. */ visibility. MOUSE_FACE_P non-zero means compare the mouse_face_p
flags of A and B, too. */
static INLINE int static INLINE int
row_equal_p (w, a, b) row_equal_p (w, a, b, mouse_face_p)
struct window *w; struct window *w;
struct glyph_row *a, *b; struct glyph_row *a, *b;
int mouse_face_p;
{ {
if (a == b) if (a == b)
return 1; return 1;
...@@ -1364,6 +1366,9 @@ row_equal_p (w, a, b) ...@@ -1364,6 +1366,9 @@ row_equal_p (w, a, b)
struct glyph *a_glyph, *b_glyph, *a_end; struct glyph *a_glyph, *b_glyph, *a_end;
int area; int area;
if (mouse_face_p && a->mouse_face_p != b->mouse_face_p)
return 0;
/* Compare glyphs. */ /* Compare glyphs. */
for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
{ {
...@@ -3417,6 +3422,12 @@ direct_output_forward_char (n) ...@@ -3417,6 +3422,12 @@ direct_output_forward_char (n)
if (!NILP (echo_area_buffer[0]) || !NILP (echo_area_buffer[1])) if (!NILP (echo_area_buffer[0]) || !NILP (echo_area_buffer[1]))
return 0; return 0;
/* Give up if currently displaying a message instead of the
minibuffer contents. */
if (XWINDOW (minibuf_window) == w
&& EQ (minibuf_window, echo_area_window))
return 0;
/* Give up if we don't know where the cursor is. */ /* Give up if we don't know where the cursor is. */
if (w->cursor.vpos < 0) if (w->cursor.vpos < 0)
return 0; return 0;
...@@ -4323,7 +4334,7 @@ add_row_entry (w, row) ...@@ -4323,7 +4334,7 @@ add_row_entry (w, row)
int i = row->hash % row_table_size; int i = row->hash % row_table_size;
entry = row_table[i]; entry = row_table[i];
while (entry && !row_equal_p (w, entry->row, row)) while (entry && !row_equal_p (w, entry->row, row, 1))
entry = entry->next; entry = entry->next;
if (entry == NULL) if (entry == NULL)
...@@ -4388,7 +4399,7 @@ scrolling_window (w, header_line_p) ...@@ -4388,7 +4399,7 @@ scrolling_window (w, header_line_p)
&& MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (current_matrix, i)) <= yb && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (current_matrix, i)) <= yb
&& row_equal_p (w, && row_equal_p (w,
MATRIX_ROW (desired_matrix, i), MATRIX_ROW (desired_matrix, i),
MATRIX_ROW (current_matrix, i))) MATRIX_ROW (current_matrix, i), 1))
{ {
assign_row (MATRIX_ROW (current_matrix, i), assign_row (MATRIX_ROW (current_matrix, i),
MATRIX_ROW (desired_matrix, i)); MATRIX_ROW (desired_matrix, i));
...@@ -4435,7 +4446,7 @@ scrolling_window (w, header_line_p) ...@@ -4435,7 +4446,7 @@ scrolling_window (w, header_line_p)
== MATRIX_ROW (desired_matrix, j - 1)->y) == MATRIX_ROW (desired_matrix, j - 1)->y)
&& row_equal_p (w, && row_equal_p (w,
MATRIX_ROW (desired_matrix, i - 1), MATRIX_ROW (desired_matrix, i - 1),
MATRIX_ROW (current_matrix, j - 1))) MATRIX_ROW (current_matrix, j - 1), 1))
--i, --j; --i, --j;
last_new = i; last_new = i;
last_old = j; last_old = j;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment