+2013-10-11 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (deep_copy_glyph_row): Handle the case that FROM and TO
+ have different dimensions. (Bug#15575)
+
+ * dispnew.c (fill_up_frame_row_with_spaces): Now has external
+ visibility.
+
+ * dispextern.h (fill_up_frame_row_with_spaces): Add prototype.
+
2013-10-11 Dmitry Antipov <dmantipov@yandex.ru>
* term.c (tty_menu_show): Never return with unbalanced
void syms_of_display (void);
extern Lisp_Object Qredisplay_dont_pause;
extern void spec_glyph_lookup_face (struct window *, GLYPH *);
+extern void fill_up_frame_row_with_spaces (struct glyph_row *, int);
/* Defined in terminal.c */
static int required_matrix_width (struct window *);
static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool);
static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
-static void fill_up_frame_row_with_spaces (struct glyph_row *, int);
static void build_frame_matrix_from_window_tree (struct glyph_matrix *,
struct window *);
static void build_frame_matrix_from_leaf_window (struct glyph_matrix *,
/* Add spaces to the end of ROW in a frame matrix until index UPTO is
reached. In frame matrices only one area, TEXT_AREA, is used. */
-static void
+void
fill_up_frame_row_with_spaces (struct glyph_row *row, int upto)
{
int i = row->used[TEXT_AREA];
deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
{
struct glyph *pointers[1 + LAST_AREA];
+ int to_used = to->used[TEXT_AREA];
/* Save glyph pointers of TO. */
memcpy (pointers, to->glyphs, sizeof to->glyphs);
- eassert (to->used[TEXT_AREA] == from->used[TEXT_AREA]);
/* Do a structure assignment. */
*to = *from;
/* Copy the glyphs. */
memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA],
- from->used[TEXT_AREA] * sizeof (struct glyph));
+ min (from->used[TEXT_AREA], to_used) * sizeof (struct glyph));
+
+ /* If we filled only part of the TO row, fill the rest with
+ space_glyph (which will display as empty space). */
+ if (to_used > from->used[TEXT_AREA])
+ fill_up_frame_row_with_spaces (to, to_used);
}
/* Display one menu item on a TTY, by overwriting the glyphs in the