(save-match-data): Add comment about using evaporate arg
[bpt/emacs.git] / src / dispnew.c
index 5ffd1a2..38e4daa 100644 (file)
@@ -1519,7 +1519,7 @@ row_equal_p (w, a, b, mouse_face_p)
          || a->left_fringe_face_id != b->left_fringe_face_id
          || a->right_fringe_bitmap != b->right_fringe_bitmap
          || a->right_fringe_face_id != b->right_fringe_face_id
-         || a->overlay_arrow_p != b->overlay_arrow_p
+         || a->overlay_arrow_bitmap != b->overlay_arrow_bitmap
          || a->exact_window_width_line_p != b->exact_window_width_line_p
          || a->overlapped_p != b->overlapped_p
          || (MATRIX_ROW_CONTINUATION_LINE_P (a)
@@ -2719,9 +2719,15 @@ build_frame_matrix_from_leaf_window (frame_matrix, w)
       if (!WINDOW_RIGHTMOST_P (w))
        {
          struct Lisp_Char_Table *dp = window_display_table (w);
-         right_border_glyph = (dp && INTEGERP (DISP_BORDER_GLYPH (dp))
-                               ? XINT (DISP_BORDER_GLYPH (dp))
-                               : '|');
+
+         right_border_glyph
+           = ((dp && INTEGERP (DISP_BORDER_GLYPH (dp)))
+              ? spec_glyph_lookup_face (w, XINT (DISP_BORDER_GLYPH (dp)))
+              : '|');
+
+         if (FAST_GLYPH_FACE (right_border_glyph) <= 0)
+           right_border_glyph
+             = FAST_MAKE_GLYPH (right_border_glyph, VERTICAL_BORDER_FACE_ID);
        }
     }
   else
@@ -2802,6 +2808,27 @@ build_frame_matrix_from_leaf_window (frame_matrix, w)
     }
 }
 
+/* Given a user-specified glyph, possibly including a Lisp-level face
+   ID, return a glyph that has a realized face ID.
+   This is used for glyphs displayed specially and not part of the text;
+   for instance, vertical separators, truncation markers, etc.  */
+
+GLYPH
+spec_glyph_lookup_face (w, glyph)
+     struct window *w;
+     GLYPH glyph;
+{
+  int lface_id = FAST_GLYPH_FACE (glyph);
+  /* Convert the glyph's specified face to a realized (cache) face.  */
+  if (lface_id > 0)
+    {
+      int face_id = merge_faces (XFRAME (w->frame),
+                                Qt, lface_id, DEFAULT_FACE_ID);
+      glyph
+       = FAST_MAKE_GLYPH (FAST_GLYPH_CHAR (glyph), face_id);
+    }
+  return glyph;
+}
 
 /* Add spaces to a glyph row ROW in a window matrix.
 
@@ -3165,14 +3192,20 @@ mirror_line_dance (w, unchanged_at_top, nlines, copy_from, retained_p)
                  int m2_from;
 
                  w2 = frame_row_to_window (root, frame_from);
-                 m2 = w2->current_matrix;
-                 m2_from = frame_from - m2->matrix_y;
-                 copy_row_except_pointers (m->rows + window_to,
-                                           m2->rows + m2_from);
-
-                 /* If frame line is empty, window line is empty, too.  */
-                 if (!retained_p[copy_from[i]])
-                   m->rows[window_to].enabled_p = 0;
+                 /* ttn@surf.glug.org: when enabling menu bar using `emacs
+                    -nw', FROM_FRAME sometimes has no associated window.
+                    This check avoids a segfault if W2 is null.  */
+                 if (w2)
+                   {
+                     m2 = w2->current_matrix;
+                     m2_from = frame_from - m2->matrix_y;
+                     copy_row_except_pointers (m->rows + window_to,
+                                               m2->rows + m2_from);
+
+                     /* If frame line is empty, window line is empty, too.  */
+                     if (!retained_p[copy_from[i]])
+                       m->rows[window_to].enabled_p = 0;
+                   }
                  sync_p = 1;
                }
              else if (from_inside_window_p)
@@ -4529,7 +4562,7 @@ update_window_line (w, vpos, mouse_face_overwritten_p)
          || desired_row->y != current_row->y
          || desired_row->visible_height != current_row->visible_height
          || desired_row->cursor_in_fringe_p != current_row->cursor_in_fringe_p
-         || desired_row->overlay_arrow_p != current_row->overlay_arrow_p
+         || desired_row->overlay_arrow_bitmap != current_row->overlay_arrow_bitmap
          || current_row->redraw_fringe_bitmaps_p
          || desired_row->mode_line_p != current_row->mode_line_p
          || desired_row->exact_window_width_line_p != current_row->exact_window_width_line_p
@@ -5039,7 +5072,7 @@ scrolling_window (w, header_line_p)
                    || to->right_fringe_bitmap != from->right_fringe_bitmap
                    || to->left_fringe_face_id != from->left_fringe_face_id
                    || to->right_fringe_face_id != from->right_fringe_face_id
-                   || to->overlay_arrow_p != from->overlay_arrow_p))
+                   || to->overlay_arrow_bitmap != from->overlay_arrow_bitmap))
              from->redraw_fringe_bitmaps_p = 1;
            assign_row (to, from);
            to->enabled_p = 1, from->enabled_p = 0;
@@ -6351,7 +6384,7 @@ sit_for (sec, usec, reading, display, initial_display)
 {
   swallow_events (display);
 
-  if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro))
+  if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_kbd_macro))
     return Qnil;
 
   if (initial_display)