aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2020-03-19 16:49:55 +0000
committerAndrea Corallo2020-03-19 16:49:55 +0000
commit981cc1575096849f70bc381e096ac5ba274a2c2f (patch)
treed6ff833bd1b446ea0a3a2ced2f9e235d97a97778 /src
parentb070571f93def7892b71a711a59bbd065c554897 (diff)
parent0128375a50352720c626fd915312a5c38762d09a (diff)
downloademacs-981cc1575096849f70bc381e096ac5ba274a2c2f.tar.gz
emacs-981cc1575096849f70bc381e096ac5ba274a2c2f.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h6
-rw-r--r--src/frame.c12
-rw-r--r--src/ftfont.c2
-rw-r--r--src/macfont.m2
-rw-r--r--src/nsterm.m10
-rw-r--r--src/regex-emacs.c25
-rw-r--r--src/timefns.c6
-rw-r--r--src/w32fns.c2
-rw-r--r--src/w32term.c3
-rw-r--r--src/w32term.h4
-rw-r--r--src/xdisp.c93
-rw-r--r--src/xfns.c2
-rw-r--r--src/xterm.c3
-rw-r--r--src/xterm.h1
14 files changed, 114 insertions, 57 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 6246c7c0808..08380f1f17f 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2782,7 +2782,8 @@ struct it
2782 else \ 2782 else \
2783 produce_glyphs ((IT)); \ 2783 produce_glyphs ((IT)); \
2784 if ((IT)->glyph_row != NULL) \ 2784 if ((IT)->glyph_row != NULL) \
2785 inhibit_free_realized_faces = true; \ 2785 inhibit_free_realized_faces =true; \
2786 reset_box_start_end_flags ((IT)); \
2786 } while (false) 2787 } while (false)
2787 2788
2788/* Bit-flags indicating what operation move_it_to should perform. */ 2789/* Bit-flags indicating what operation move_it_to should perform. */
@@ -3003,6 +3004,9 @@ struct redisplay_interface
3003 /* Cancel hourglass cursor on frame F. */ 3004 /* Cancel hourglass cursor on frame F. */
3004 void (*hide_hourglass) (struct frame *f); 3005 void (*hide_hourglass) (struct frame *f);
3005 3006
3007 /* Called to (re)calculate the default face when changing the font
3008 backend. */
3009 void (*default_font_parameter) (struct frame *f, Lisp_Object parms);
3006#endif /* HAVE_WINDOW_SYSTEM */ 3010#endif /* HAVE_WINDOW_SYSTEM */
3007}; 3011};
3008 3012
diff --git a/src/frame.c b/src/frame.c
index 51fc78ab703..c7e4f2f6bd9 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4565,7 +4565,11 @@ gui_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_va
4565 return; 4565 return;
4566 4566
4567 if (FRAME_FONT (f)) 4567 if (FRAME_FONT (f))
4568 free_all_realized_faces (Qnil); 4568 {
4569 Lisp_Object frame;
4570 XSETFRAME (frame, f);
4571 free_all_realized_faces (frame);
4572 }
4569 4573
4570 new_value = font_update_drivers (f, NILP (new_value) ? Qt : new_value); 4574 new_value = font_update_drivers (f, NILP (new_value) ? Qt : new_value);
4571 if (NILP (new_value)) 4575 if (NILP (new_value))
@@ -4579,10 +4583,8 @@ gui_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_va
4579 4583
4580 if (FRAME_FONT (f)) 4584 if (FRAME_FONT (f))
4581 { 4585 {
4582 Lisp_Object frame; 4586 /* Reconsider default font after backend(s) change (Bug#23386). */
4583 4587 FRAME_RIF(f)->default_font_parameter (f, Qnil);
4584 XSETFRAME (frame, f);
4585 gui_set_font (f, Fframe_parameter (frame, Qfont), Qnil);
4586 face_change = true; 4588 face_change = true;
4587 windows_or_buffers_changed = 18; 4589 windows_or_buffers_changed = 18;
4588 } 4590 }
diff --git a/src/ftfont.c b/src/ftfont.c
index 219e21408e8..2b442ead4bf 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -102,7 +102,7 @@ static struct
102 { "iso8859-15", { 0x00A0, 0x00A1, 0x00D0, 0x0152 }}, 102 { "iso8859-15", { 0x00A0, 0x00A1, 0x00D0, 0x0152 }},
103 { "iso8859-16", { 0x00A0, 0x0218}}, 103 { "iso8859-16", { 0x00A0, 0x0218}},
104 { "gb2312.1980-0", { 0x4E13 }, "zh-cn"}, 104 { "gb2312.1980-0", { 0x4E13 }, "zh-cn"},
105 { "big5-0", { 0xF6B1 }, "zh-tw" }, 105 { "big5-0", { 0x9C21 }, "zh-tw" },
106 { "jisx0208.1983-0", { 0x4E55 }, "ja"}, 106 { "jisx0208.1983-0", { 0x4E55 }, "ja"},
107 { "ksc5601.1985-0", { 0xAC00 }, "ko"}, 107 { "ksc5601.1985-0", { 0xAC00 }, "ko"},
108 { "cns11643.1992-1", { 0xFE32 }, "zh-tw"}, 108 { "cns11643.1992-1", { 0xFE32 }, "zh-tw"},
diff --git a/src/macfont.m b/src/macfont.m
index 442a2566037..21bc7dde5b3 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -664,7 +664,7 @@ static struct
664 { "iso8859-15", { 0x00A0, 0x00A1, 0x00D0, 0x0152 }}, 664 { "iso8859-15", { 0x00A0, 0x00A1, 0x00D0, 0x0152 }},
665 { "iso8859-16", { 0x00A0, 0x0218}}, 665 { "iso8859-16", { 0x00A0, 0x0218}},
666 { "gb2312.1980-0", { 0x4E13 }, CFSTR ("zh-Hans")}, 666 { "gb2312.1980-0", { 0x4E13 }, CFSTR ("zh-Hans")},
667 { "big5-0", { /* 0xF6B1 in ftfont.c */ 0x4EDC }, CFSTR ("zh-Hant") }, 667 { "big5-0", { /* 0x9C21 in ftfont.c */ 0x4EDC }, CFSTR ("zh-Hant") },
668 { "jisx0208.1983-0", { 0x4E55 }, CFSTR ("ja")}, 668 { "jisx0208.1983-0", { 0x4E55 }, CFSTR ("ja")},
669 { "ksc5601.1987-0", { 0xAC00 }, CFSTR ("ko")}, 669 { "ksc5601.1987-0", { 0xAC00 }, CFSTR ("ko")},
670 { "cns11643.1992-1", { 0xFE32 }, CFSTR ("zh-Hant")}, 670 { "cns11643.1992-1", { 0xFE32 }, CFSTR ("zh-Hant")},
diff --git a/src/nsterm.m b/src/nsterm.m
index 96a7fdc0184..04fc0512234 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5155,6 +5155,13 @@ ns_initialize_display_info (struct ns_display_info *dpyinfo)
5155 reset_mouse_highlight (&dpyinfo->mouse_highlight); 5155 reset_mouse_highlight (&dpyinfo->mouse_highlight);
5156} 5156}
5157 5157
5158/* This currently does nothing, since it's only really needed when
5159 changing the font-backend, but macOS currently only has one
5160 possible backend. This may change if we add HarfBuzz support. */
5161static void
5162ns_default_font_parameter (struct frame *f, Lisp_Object parms)
5163{
5164}
5158 5165
5159/* This and next define (many of the) public functions in this file. */ 5166/* This and next define (many of the) public functions in this file. */
5160/* gui_* are generic versions in xdisp.c that we, and other terms, get away 5167/* gui_* are generic versions in xdisp.c that we, and other terms, get away
@@ -5190,7 +5197,8 @@ static struct redisplay_interface ns_redisplay_interface =
5190 ns_draw_window_divider, 5197 ns_draw_window_divider,
5191 ns_shift_glyphs_for_insert, 5198 ns_shift_glyphs_for_insert,
5192 ns_show_hourglass, 5199 ns_show_hourglass,
5193 ns_hide_hourglass 5200 ns_hide_hourglass,
5201 ns_default_font_parameter
5194}; 5202};
5195 5203
5196 5204
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 694431c95e2..0ae004e4636 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -2113,17 +2113,20 @@ regex_compile (re_char *pattern, ptrdiff_t size,
2113 if (CHAR_BYTE8_P (c1)) 2113 if (CHAR_BYTE8_P (c1))
2114 c = BYTE8_TO_CHAR (128); 2114 c = BYTE8_TO_CHAR (128);
2115 } 2115 }
2116 if (CHAR_BYTE8_P (c)) 2116 if (c <= c1)
2117 { 2117 {
2118 c = CHAR_TO_BYTE8 (c); 2118 if (CHAR_BYTE8_P (c))
2119 c1 = CHAR_TO_BYTE8 (c1); 2119 {
2120 for (; c <= c1; c++) 2120 c = CHAR_TO_BYTE8 (c);
2121 SET_LIST_BIT (c); 2121 c1 = CHAR_TO_BYTE8 (c1);
2122 } 2122 for (; c <= c1; c++)
2123 else if (multibyte) 2123 SET_LIST_BIT (c);
2124 SETUP_MULTIBYTE_RANGE (range_table_work, c, c1); 2124 }
2125 else 2125 else if (multibyte)
2126 SETUP_UNIBYTE_RANGE (range_table_work, c, c1); 2126 SETUP_MULTIBYTE_RANGE (range_table_work, c, c1);
2127 else
2128 SETUP_UNIBYTE_RANGE (range_table_work, c, c1);
2129 }
2127 } 2130 }
2128 } 2131 }
2129 2132
diff --git a/src/timefns.c b/src/timefns.c
index 404ce4973b7..7bcc37d7c1e 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -593,7 +593,7 @@ timespec_to_lisp (struct timespec t)
593} 593}
594 594
595/* Return NUMERATOR / DENOMINATOR, rounded to the nearest double. 595/* Return NUMERATOR / DENOMINATOR, rounded to the nearest double.
596 Arguments must be Lisp integers, and DENOMINATOR must be nonzero. */ 596 Arguments must be Lisp integers, and DENOMINATOR must be positive. */
597static double 597static double
598frac_to_double (Lisp_Object numerator, Lisp_Object denominator) 598frac_to_double (Lisp_Object numerator, Lisp_Object denominator)
599{ 599{
@@ -601,7 +601,6 @@ frac_to_double (Lisp_Object numerator, Lisp_Object denominator)
601 if (FASTER_TIMEFNS 601 if (FASTER_TIMEFNS
602 && integer_to_intmax (numerator, &intmax_numerator) 602 && integer_to_intmax (numerator, &intmax_numerator)
603 && integer_to_intmax (denominator, &intmax_denominator) 603 && integer_to_intmax (denominator, &intmax_denominator)
604 && ! INT_DIVIDE_OVERFLOW (intmax_numerator, intmax_denominator)
605 && intmax_numerator % intmax_denominator == 0) 604 && intmax_numerator % intmax_denominator == 0)
606 return intmax_numerator / intmax_denominator; 605 return intmax_numerator / intmax_denominator;
607 606
@@ -611,9 +610,6 @@ frac_to_double (Lisp_Object numerator, Lisp_Object denominator)
611 ptrdiff_t ndig = mpz_sizeinbase (*n, FLT_RADIX); 610 ptrdiff_t ndig = mpz_sizeinbase (*n, FLT_RADIX);
612 ptrdiff_t ddig = mpz_sizeinbase (*d, FLT_RADIX); 611 ptrdiff_t ddig = mpz_sizeinbase (*d, FLT_RADIX);
613 612
614 if (FASTER_TIMEFNS && ndig <= DBL_MANT_DIG && ddig <= DBL_MANT_DIG)
615 return mpz_get_d (*n) / mpz_get_d (*d);
616
617 /* Scale with SCALE when doing integer division. That is, compute 613 /* Scale with SCALE when doing integer division. That is, compute
618 (N * FLT_RADIX**SCALE) / D [or, if SCALE is negative, N / (D * 614 (N * FLT_RADIX**SCALE) / D [or, if SCALE is negative, N / (D *
619 FLT_RADIX**-SCALE)] as a bignum, convert the bignum to double, 615 FLT_RADIX**-SCALE)] as a bignum, convert the bignum to double,
diff --git a/src/w32fns.c b/src/w32fns.c
index 61e22e57009..2f01fb52e92 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5749,7 +5749,7 @@ do_unwind_create_frame (Lisp_Object frame)
5749 unwind_create_frame (frame); 5749 unwind_create_frame (frame);
5750} 5750}
5751 5751
5752static void 5752void
5753w32_default_font_parameter (struct frame *f, Lisp_Object parms) 5753w32_default_font_parameter (struct frame *f, Lisp_Object parms)
5754{ 5754{
5755 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 5755 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
diff --git a/src/w32term.c b/src/w32term.c
index f515f5604d6..76cf6bd6964 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -7249,7 +7249,8 @@ static struct redisplay_interface w32_redisplay_interface =
7249 w32_draw_window_divider, 7249 w32_draw_window_divider,
7250 w32_shift_glyphs_for_insert, 7250 w32_shift_glyphs_for_insert,
7251 w32_show_hourglass, 7251 w32_show_hourglass,
7252 w32_hide_hourglass 7252 w32_hide_hourglass,
7253 w32_default_font_parameter
7253}; 7254};
7254 7255
7255static void w32_delete_terminal (struct terminal *term); 7256static void w32_delete_terminal (struct terminal *term);
diff --git a/src/w32term.h b/src/w32term.h
index 737764b8942..f8a8a727e8a 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -267,6 +267,10 @@ extern void w32con_show_cursor (void);
267extern const char *w32_get_string_resource (void *v_rdb, 267extern const char *w32_get_string_resource (void *v_rdb,
268 const char *name, 268 const char *name,
269 const char *class); 269 const char *class);
270
271/* w32fns.c */
272extern void w32_default_font_parameter (struct frame* f, Lisp_Object parms);
273
270 274
271#define PIX_TYPE COLORREF 275#define PIX_TYPE COLORREF
272 276
diff --git a/src/xdisp.c b/src/xdisp.c
index 3c594b54add..04fc8aa3c45 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1020,6 +1020,7 @@ static Lisp_Object calc_line_height_property (struct it *, Lisp_Object,
1020static void produce_special_glyphs (struct it *, enum display_element_type); 1020static void produce_special_glyphs (struct it *, enum display_element_type);
1021static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face); 1021static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
1022static bool coords_in_mouse_face_p (struct window *, int, int); 1022static bool coords_in_mouse_face_p (struct window *, int, int);
1023static void reset_box_start_end_flags (struct it *);
1023 1024
1024 1025
1025 1026
@@ -1435,6 +1436,29 @@ window_hscroll_limited (struct window *w, struct frame *f)
1435 return window_hscroll; 1436 return window_hscroll;
1436} 1437}
1437 1438
1439/* Reset the box-face start and end flags in the iterator. This is
1440 called after producing glyphs, such that we reset these flags only
1441 after producing a glyph with the flag set. */
1442
1443static void
1444reset_box_start_end_flags (struct it *it)
1445{
1446 /* Don't reset if we've drawn the glyph in the display margins --
1447 those don't count as "produced glyphs". */
1448 if (it->area == TEXT_AREA
1449 /* Don't reset if we displayed a fringe bitmap. */
1450 && !(it->what == IT_IMAGE && it->image_id < 0))
1451 {
1452 /* Don't reset if the face is not a box face: that might mean we
1453 are iterating some overlay or display string, and the first
1454 character to have the box face is yet to be seen, when we pop
1455 the iterator stack. */
1456 if (it->face_box_p)
1457 it->start_of_box_run_p = false;
1458 it->end_of_box_run_p = false;
1459 }
1460}
1461
1438/* Return true if position CHARPOS is visible in window W. 1462/* Return true if position CHARPOS is visible in window W.
1439 CHARPOS < 0 means return info about WINDOW_END position. 1463 CHARPOS < 0 means return info about WINDOW_END position.
1440 If visible, set *X and *Y to pixel coordinates of top left corner. 1464 If visible, set *X and *Y to pixel coordinates of top left corner.
@@ -4315,8 +4339,11 @@ handle_face_prop (struct it *it)
4315 this is the start of a run of characters with box face, 4339 this is the start of a run of characters with box face,
4316 i.e. this character has a shadow on the left side. */ 4340 i.e. this character has a shadow on the left side. */
4317 it->face_id = new_face_id; 4341 it->face_id = new_face_id;
4318 it->start_of_box_run_p = (new_face->box != FACE_NO_BOX 4342 /* Don't reset the start_of_box_run_p flag, only set it if
4319 && (old_face == NULL || !old_face->box)); 4343 needed. */
4344 if (!(it->start_of_box_run_p && old_face && old_face->box))
4345 it->start_of_box_run_p = (new_face->box != FACE_NO_BOX
4346 && (old_face == NULL || !old_face->box));
4320 it->face_box_p = new_face->box != FACE_NO_BOX; 4347 it->face_box_p = new_face->box != FACE_NO_BOX;
4321 } 4348 }
4322 4349
@@ -6457,7 +6484,16 @@ pop_it (struct it *it)
6457 it->object = p->u.stretch.object; 6484 it->object = p->u.stretch.object;
6458 break; 6485 break;
6459 case GET_FROM_BUFFER: 6486 case GET_FROM_BUFFER:
6460 it->object = it->w->contents; 6487 {
6488 struct face *face = FACE_FROM_ID_OR_NULL (it->f, it->face_id);
6489
6490 /* Restore the face_box_p flag, since it could have been
6491 overwritten by the face of the object that we just finished
6492 displaying. */
6493 if (face)
6494 it->face_box_p = face->box != FACE_NO_BOX;
6495 it->object = it->w->contents;
6496 }
6461 break; 6497 break;
6462 case GET_FROM_STRING: 6498 case GET_FROM_STRING:
6463 { 6499 {
@@ -7586,9 +7622,8 @@ get_next_display_element (struct it *it)
7586 /* If the box comes from face properties in a 7622 /* If the box comes from face properties in a
7587 display string, check faces in that string. */ 7623 display string, check faces in that string. */
7588 int string_face_id = face_after_it_pos (it); 7624 int string_face_id = face_after_it_pos (it);
7589 it->end_of_box_run_p 7625 if (FACE_FROM_ID (it->f, string_face_id)->box == FACE_NO_BOX)
7590 = (FACE_FROM_ID (it->f, string_face_id)->box 7626 it->end_of_box_run_p = true;
7591 == FACE_NO_BOX);
7592 } 7627 }
7593 /* Otherwise, the box comes from the underlying face. 7628 /* Otherwise, the box comes from the underlying face.
7594 If this is the last string character displayed, check 7629 If this is the last string character displayed, check
@@ -7657,9 +7692,9 @@ get_next_display_element (struct it *it)
7657 CHARPOS (pos), 0, 7692 CHARPOS (pos), 0,
7658 &ignore, face_id, 7693 &ignore, face_id,
7659 false, 0); 7694 false, 0);
7660 it->end_of_box_run_p 7695 if (FACE_FROM_ID (it->f, next_face_id)->box
7661 = (FACE_FROM_ID (it->f, next_face_id)->box 7696 == FACE_NO_BOX)
7662 == FACE_NO_BOX); 7697 it->end_of_box_run_p = true;
7663 } 7698 }
7664 } 7699 }
7665 else if (CHARPOS (pos) >= ZV) 7700 else if (CHARPOS (pos) >= ZV)
@@ -7672,9 +7707,9 @@ get_next_display_element (struct it *it)
7672 CHARPOS (pos) 7707 CHARPOS (pos)
7673 + TEXT_PROP_DISTANCE_LIMIT, 7708 + TEXT_PROP_DISTANCE_LIMIT,
7674 false, -1, 0); 7709 false, -1, 0);
7675 it->end_of_box_run_p 7710 if (FACE_FROM_ID (it->f, next_face_id)->box
7676 = (FACE_FROM_ID (it->f, next_face_id)->box 7711 == FACE_NO_BOX)
7677 == FACE_NO_BOX); 7712 it->end_of_box_run_p = true;
7678 } 7713 }
7679 } 7714 }
7680 } 7715 }
@@ -7684,9 +7719,9 @@ get_next_display_element (struct it *it)
7684 else if (it->method != GET_FROM_DISPLAY_VECTOR) 7719 else if (it->method != GET_FROM_DISPLAY_VECTOR)
7685 { 7720 {
7686 int face_id = face_after_it_pos (it); 7721 int face_id = face_after_it_pos (it);
7687 it->end_of_box_run_p 7722 if (face_id != it->face_id
7688 = (face_id != it->face_id 7723 && FACE_FROM_ID (it->f, face_id)->box == FACE_NO_BOX)
7689 && FACE_FROM_ID (it->f, face_id)->box == FACE_NO_BOX); 7724 it->end_of_box_run_p = true;
7690 } 7725 }
7691 } 7726 }
7692 /* If we reached the end of the object we've been iterating (e.g., a 7727 /* If we reached the end of the object we've been iterating (e.g., a
@@ -7723,10 +7758,6 @@ get_next_display_element (struct it *it)
7723void 7758void
7724set_iterator_to_next (struct it *it, bool reseat_p) 7759set_iterator_to_next (struct it *it, bool reseat_p)
7725{ 7760{
7726 /* Reset flags indicating start and end of a sequence of characters
7727 with box. Reset them at the start of this function because
7728 moving the iterator to a new position might set them. */
7729 it->start_of_box_run_p = it->end_of_box_run_p = false;
7730 7761
7731 switch (it->method) 7762 switch (it->method)
7732 { 7763 {
@@ -8138,9 +8169,9 @@ next_element_from_display_vector (struct it *it)
8138 } 8169 }
8139 } 8170 }
8140 next_face = FACE_FROM_ID_OR_NULL (it->f, next_face_id); 8171 next_face = FACE_FROM_ID_OR_NULL (it->f, next_face_id);
8141 it->end_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX 8172 if (this_face && this_face->box != FACE_NO_BOX
8142 && (!next_face 8173 && (!next_face || next_face->box == FACE_NO_BOX))
8143 || next_face->box == FACE_NO_BOX)); 8174 it->end_of_box_run_p = true;
8144 it->face_box_p = this_face && this_face->box != FACE_NO_BOX; 8175 it->face_box_p = this_face && this_face->box != FACE_NO_BOX;
8145 } 8176 }
8146 else 8177 else
@@ -21485,6 +21516,8 @@ append_space_for_newline (struct it *it, bool default_face_p)
21485 21516
21486 const int indicator_column = 21517 const int indicator_column =
21487 fill_column_indicator_column (it, char_width); 21518 fill_column_indicator_column (it, char_width);
21519 int saved_end_of_box_run = it->end_of_box_run_p;
21520 bool should_keep_end_of_box_run = false;
21488 21521
21489 if (it->current_x == indicator_column) 21522 if (it->current_x == indicator_column)
21490 { 21523 {
@@ -21507,14 +21540,18 @@ append_space_for_newline (struct it *it, bool default_face_p)
21507 have the end_of_box_run_p flag set for it, so there's no 21540 have the end_of_box_run_p flag set for it, so there's no
21508 need for the appended newline glyph to have that flag 21541 need for the appended newline glyph to have that flag
21509 set. */ 21542 set. */
21510 if (it->glyph_row->reversed_p 21543 if (!(it->glyph_row->reversed_p
21511 /* But if the appended newline glyph goes all the way to 21544 /* But if the appended newline glyph goes all the way to
21512 the end of the row, there will be no stretch glyph, 21545 the end of the row, there will be no stretch glyph,
21513 so leave the box flag set. */ 21546 so leave the box flag set. */
21514 && saved_x + FRAME_COLUMN_WIDTH (it->f) < it->last_visible_x) 21547 && saved_x + FRAME_COLUMN_WIDTH (it->f) < it->last_visible_x))
21515 it->end_of_box_run_p = false; 21548 should_keep_end_of_box_run = true;
21516 } 21549 }
21517 PRODUCE_GLYPHS (it); 21550 PRODUCE_GLYPHS (it);
21551 /* Restore the end_of_box_run_p flag which was reset by
21552 PRODUCE_GLYPHS. */
21553 if (should_keep_end_of_box_run)
21554 it->end_of_box_run_p = saved_end_of_box_run;
21518#ifdef HAVE_WINDOW_SYSTEM 21555#ifdef HAVE_WINDOW_SYSTEM
21519 if (FRAME_WINDOW_P (it->f)) 21556 if (FRAME_WINDOW_P (it->f))
21520 { 21557 {
diff --git a/src/xfns.c b/src/xfns.c
index 5758bb7a18c..8de4c8bfd9e 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3555,7 +3555,7 @@ do_unwind_create_frame (Lisp_Object frame)
3555 unwind_create_frame (frame); 3555 unwind_create_frame (frame);
3556} 3556}
3557 3557
3558static void 3558void
3559x_default_font_parameter (struct frame *f, Lisp_Object parms) 3559x_default_font_parameter (struct frame *f, Lisp_Object parms)
3560{ 3560{
3561 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 3561 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
diff --git a/src/xterm.c b/src/xterm.c
index 5d229e4f524..d7d992c91b2 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -13384,7 +13384,8 @@ static struct redisplay_interface x_redisplay_interface =
13384 x_draw_window_divider, 13384 x_draw_window_divider,
13385 x_shift_glyphs_for_insert, /* Never called; see comment in function. */ 13385 x_shift_glyphs_for_insert, /* Never called; see comment in function. */
13386 x_show_hourglass, 13386 x_show_hourglass,
13387 x_hide_hourglass 13387 x_hide_hourglass,
13388 x_default_font_parameter
13388 }; 13389 };
13389 13390
13390 13391
diff --git a/src/xterm.h b/src/xterm.h
index 51e75890b60..bc10043c54c 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1056,6 +1056,7 @@ extern void x_real_pos_and_offsets (struct frame *f,
1056 int *xptr, 1056 int *xptr,
1057 int *yptr, 1057 int *yptr,
1058 int *outer_border); 1058 int *outer_border);
1059extern void x_default_font_parameter (struct frame* f, Lisp_Object parms);
1059 1060
1060/* From xrdb.c. */ 1061/* From xrdb.c. */
1061 1062