aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2020-11-22 22:23:16 +0100
committerAndrea Corallo2020-11-22 22:23:16 +0100
commit033e96055cc172d8d84adc128aee7f7d9889bb00 (patch)
tree4e6e0a24c60f4c8776fb574bf31727dcaf4af4ba /src
parent6781cd670d1487bbf0364d80de68ca9733342769 (diff)
parent9b6ad3107f93d40f82c3c53dc0984c6d70aded83 (diff)
downloademacs-033e96055cc172d8d84adc128aee7f7d9889bb00.tar.gz
emacs-033e96055cc172d8d84adc128aee7f7d9889bb00.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c7
-rw-r--r--src/buffer.h3
-rw-r--r--src/data.c12
-rw-r--r--src/dispnew.c10
-rw-r--r--src/fns.c23
-rw-r--r--src/image.c45
-rw-r--r--src/keyboard.c14
-rw-r--r--src/keymap.c30
-rw-r--r--src/minibuf.c5
-rw-r--r--src/term.c8
-rw-r--r--src/termhooks.h4
-rw-r--r--src/w32term.c16
-rw-r--r--src/window.c21
-rw-r--r--src/xdisp.c18
-rw-r--r--src/xterm.c24
15 files changed, 130 insertions, 110 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 4fd2b0c8b17..360dd348e05 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -297,11 +297,6 @@ bset_mark (struct buffer *b, Lisp_Object val)
297 b->mark_ = val; 297 b->mark_ = val;
298} 298}
299static void 299static void
300bset_minor_modes (struct buffer *b, Lisp_Object val)
301{
302 b->minor_modes_ = val;
303}
304static void
305bset_mode_line_format (struct buffer *b, Lisp_Object val) 300bset_mode_line_format (struct buffer *b, Lisp_Object val)
306{ 301{
307 b->mode_line_format_ = val; 302 b->mode_line_format_ = val;
@@ -1004,7 +999,6 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too)
1004 bset_major_mode (b, Qfundamental_mode); 999 bset_major_mode (b, Qfundamental_mode);
1005 bset_keymap (b, Qnil); 1000 bset_keymap (b, Qnil);
1006 bset_mode_name (b, QSFundamental); 1001 bset_mode_name (b, QSFundamental);
1007 bset_minor_modes (b, Qnil);
1008 1002
1009 /* If the standard case table has been altered and invalidated, 1003 /* If the standard case table has been altered and invalidated,
1010 fix up its insides first. */ 1004 fix up its insides first. */
@@ -5180,7 +5174,6 @@ init_buffer_once (void)
5180 bset_upcase_table (&buffer_local_flags, make_fixnum (0)); 5174 bset_upcase_table (&buffer_local_flags, make_fixnum (0));
5181 bset_case_canon_table (&buffer_local_flags, make_fixnum (0)); 5175 bset_case_canon_table (&buffer_local_flags, make_fixnum (0));
5182 bset_case_eqv_table (&buffer_local_flags, make_fixnum (0)); 5176 bset_case_eqv_table (&buffer_local_flags, make_fixnum (0));
5183 bset_minor_modes (&buffer_local_flags, make_fixnum (0));
5184 bset_width_table (&buffer_local_flags, make_fixnum (0)); 5177 bset_width_table (&buffer_local_flags, make_fixnum (0));
5185 bset_pt_marker (&buffer_local_flags, make_fixnum (0)); 5178 bset_pt_marker (&buffer_local_flags, make_fixnum (0));
5186 bset_begv_marker (&buffer_local_flags, make_fixnum (0)); 5179 bset_begv_marker (&buffer_local_flags, make_fixnum (0));
diff --git a/src/buffer.h b/src/buffer.h
index 3da49414bb8..fe549c5dac1 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -419,9 +419,6 @@ struct buffer
419 /* Non-nil means show ... at end of line followed by invisible lines. */ 419 /* Non-nil means show ... at end of line followed by invisible lines. */
420 Lisp_Object selective_display_ellipses_; 420 Lisp_Object selective_display_ellipses_;
421 421
422 /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */
423 Lisp_Object minor_modes_;
424
425 /* t if "self-insertion" should overwrite; `binary' if it should also 422 /* t if "self-insertion" should overwrite; `binary' if it should also
426 overwrite newlines and tabs - for editing executables and the like. */ 423 overwrite newlines and tabs - for editing executables and the like. */
427 Lisp_Object overwrite_mode_; 424 Lisp_Object overwrite_mode_;
diff --git a/src/data.c b/src/data.c
index c6629dd5f29..1435cb03779 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1501,10 +1501,14 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
1501 { 1501 {
1502 int offset = XBUFFER_OBJFWD (innercontents)->offset; 1502 int offset = XBUFFER_OBJFWD (innercontents)->offset;
1503 int idx = PER_BUFFER_IDX (offset); 1503 int idx = PER_BUFFER_IDX (offset);
1504 if (idx > 0 1504 if (idx > 0 && bindflag == SET_INTERNAL_SET
1505 && bindflag == SET_INTERNAL_SET 1505 && !PER_BUFFER_VALUE_P (buf, idx))
1506 && !let_shadows_buffer_binding_p (sym)) 1506 {
1507 SET_PER_BUFFER_VALUE_P (buf, idx, 1); 1507 if (let_shadows_buffer_binding_p (sym))
1508 set_default_internal (symbol, newval, bindflag);
1509 else
1510 SET_PER_BUFFER_VALUE_P (buf, idx, 1);
1511 }
1508 } 1512 }
1509 1513
1510 if (voide) 1514 if (voide)
diff --git a/src/dispnew.c b/src/dispnew.c
index 479fccb45e0..89dd32ad0fb 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -2558,11 +2558,15 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w
2558 the corresponding frame row to be updated. */ 2558 the corresponding frame row to be updated. */
2559 frame_row->enabled_p = true; 2559 frame_row->enabled_p = true;
2560 2560
2561 /* Maybe insert a vertical border between horizontally adjacent 2561 /* Maybe insert a vertical border between horizontally adjacent
2562 windows. */ 2562 windows. */
2563 if (GLYPH_CHAR (right_border_glyph) != 0) 2563 if (GLYPH_CHAR (right_border_glyph) != 0)
2564 { 2564 {
2565 struct glyph *border = window_row->glyphs[LAST_AREA] - 1; 2565 struct glyph *border = window_row->glyphs[LAST_AREA] - 1;
2566 /* It's a subtle bug if we are overwriting some non-char
2567 glyph with the vertical border glyph. */
2568 eassert (border->type == CHAR_GLYPH);
2569 border->type = CHAR_GLYPH;
2566 SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); 2570 SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph);
2567 } 2571 }
2568 2572
diff --git a/src/fns.c b/src/fns.c
index f50bf8ecb77..e4c9acc3163 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -5502,25 +5502,32 @@ Case is always significant and text properties are ignored. */)
5502 haybytes = SBYTES (haystack) - start_byte; 5502 haybytes = SBYTES (haystack) - start_byte;
5503 5503
5504 /* We can do a direct byte-string search if both strings have the 5504 /* We can do a direct byte-string search if both strings have the
5505 same multibyteness, or if at least one of them consists of ASCII 5505 same multibyteness, or if the needle consists of ASCII characters only. */
5506 characters only. */
5507 if (STRING_MULTIBYTE (haystack) 5506 if (STRING_MULTIBYTE (haystack)
5508 ? (STRING_MULTIBYTE (needle) 5507 ? (STRING_MULTIBYTE (needle)
5509 || SCHARS (haystack) == SBYTES (haystack) || string_ascii_p (needle)) 5508 || SCHARS (haystack) == SBYTES (haystack) || string_ascii_p (needle))
5510 : (!STRING_MULTIBYTE (needle) 5509 : (!STRING_MULTIBYTE (needle)
5511 || SCHARS (needle) == SBYTES (needle) || string_ascii_p (haystack))) 5510 || SCHARS (needle) == SBYTES (needle)))
5512 res = memmem (haystart, haybytes, 5511 {
5513 SSDATA (needle), SBYTES (needle)); 5512 if (STRING_MULTIBYTE (haystack) && STRING_MULTIBYTE (needle)
5514 else if (STRING_MULTIBYTE (haystack)) /* unibyte needle */ 5513 && SCHARS (haystack) == SBYTES (haystack)
5514 && SCHARS (needle) != SBYTES (needle))
5515 /* Multibyte non-ASCII needle, multibyte ASCII haystack: impossible. */
5516 return Qnil;
5517 else
5518 res = memmem (haystart, haybytes,
5519 SSDATA (needle), SBYTES (needle));
5520 }
5521 else if (STRING_MULTIBYTE (haystack)) /* unibyte non-ASCII needle */
5515 { 5522 {
5516 Lisp_Object multi_needle = string_to_multibyte (needle); 5523 Lisp_Object multi_needle = string_to_multibyte (needle);
5517 res = memmem (haystart, haybytes, 5524 res = memmem (haystart, haybytes,
5518 SSDATA (multi_needle), SBYTES (multi_needle)); 5525 SSDATA (multi_needle), SBYTES (multi_needle));
5519 } 5526 }
5520 else /* unibyte haystack, multibyte needle */ 5527 else /* unibyte haystack, multibyte non-ASCII needle */
5521 { 5528 {
5522 /* The only possible way we can find the multibyte needle in the 5529 /* The only possible way we can find the multibyte needle in the
5523 unibyte stack (since we know that neither are pure-ASCII) is 5530 unibyte stack (since we know that the needle is non-ASCII) is
5524 if they contain "raw bytes" (and no other non-ASCII chars.) */ 5531 if they contain "raw bytes" (and no other non-ASCII chars.) */
5525 ptrdiff_t nbytes = SBYTES (needle); 5532 ptrdiff_t nbytes = SBYTES (needle);
5526 for (ptrdiff_t i = 0; i < nbytes; i++) 5533 for (ptrdiff_t i = 0; i < nbytes; i++)
diff --git a/src/image.c b/src/image.c
index 3858f3c41f3..5eb41322950 100644
--- a/src/image.c
+++ b/src/image.c
@@ -9551,10 +9551,9 @@ DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions,
9551DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, 9551DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer,
9552 (RsvgHandle *, const char *, const RsvgRectangle *, 9552 (RsvgHandle *, const char *, const RsvgRectangle *,
9553 RsvgRectangle *, RsvgRectangle *, GError **)); 9553 RsvgRectangle *, RsvgRectangle *, GError **));
9554# else 9554# endif
9555DEF_DLL_FN (void, rsvg_handle_get_dimensions, 9555DEF_DLL_FN (void, rsvg_handle_get_dimensions,
9556 (RsvgHandle *, RsvgDimensionData *)); 9556 (RsvgHandle *, RsvgDimensionData *));
9557# endif
9558DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); 9557DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *));
9559DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *)); 9558DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *));
9560DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *)); 9559DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *));
@@ -9604,9 +9603,8 @@ init_svg_functions (void)
9604#if LIBRSVG_CHECK_VERSION (2, 46, 0) 9603#if LIBRSVG_CHECK_VERSION (2, 46, 0)
9605 LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions); 9604 LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions);
9606 LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); 9605 LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer);
9607#else
9608 LOAD_DLL_FN (library, rsvg_handle_get_dimensions);
9609#endif 9606#endif
9607 LOAD_DLL_FN (library, rsvg_handle_get_dimensions);
9610 LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); 9608 LOAD_DLL_FN (library, rsvg_handle_get_pixbuf);
9611 9609
9612 LOAD_DLL_FN (gdklib, gdk_pixbuf_get_width); 9610 LOAD_DLL_FN (gdklib, gdk_pixbuf_get_width);
@@ -9644,9 +9642,8 @@ init_svg_functions (void)
9644# if LIBRSVG_CHECK_VERSION (2, 46, 0) 9642# if LIBRSVG_CHECK_VERSION (2, 46, 0)
9645# undef rsvg_handle_get_intrinsic_dimensions 9643# undef rsvg_handle_get_intrinsic_dimensions
9646# undef rsvg_handle_get_geometry_for_layer 9644# undef rsvg_handle_get_geometry_for_layer
9647# else
9648# undef rsvg_handle_get_dimensions
9649# endif 9645# endif
9646# undef rsvg_handle_get_dimensions
9650# undef rsvg_handle_get_pixbuf 9647# undef rsvg_handle_get_pixbuf
9651# if LIBRSVG_CHECK_VERSION (2, 32, 0) 9648# if LIBRSVG_CHECK_VERSION (2, 32, 0)
9652# undef g_file_new_for_path 9649# undef g_file_new_for_path
@@ -9677,9 +9674,8 @@ init_svg_functions (void)
9677 fn_rsvg_handle_get_intrinsic_dimensions 9674 fn_rsvg_handle_get_intrinsic_dimensions
9678# define rsvg_handle_get_geometry_for_layer \ 9675# define rsvg_handle_get_geometry_for_layer \
9679 fn_rsvg_handle_get_geometry_for_layer 9676 fn_rsvg_handle_get_geometry_for_layer
9680# else
9681# define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions
9682# endif 9677# endif
9678# define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions
9683# define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf 9679# define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf
9684# if LIBRSVG_CHECK_VERSION (2, 32, 0) 9680# if LIBRSVG_CHECK_VERSION (2, 32, 0)
9685# define g_file_new_for_path fn_g_file_new_for_path 9681# define g_file_new_for_path fn_g_file_new_for_path
@@ -9903,30 +9899,21 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
9903 viewbox_width = viewbox.x + viewbox.width; 9899 viewbox_width = viewbox.x + viewbox.width;
9904 viewbox_height = viewbox.y + viewbox.height; 9900 viewbox_height = viewbox.y + viewbox.height;
9905 } 9901 }
9906#else
9907 /* The function used above to get the geometry of the visible area
9908 of the SVG are only available in librsvg 2.46 and above, so in
9909 certain circumstances this code path can result in some parts of
9910 the SVG being cropped. */
9911 RsvgDimensionData dimension_data;
9912 9902
9913 rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); 9903 if (viewbox_width == 0 || viewbox_height == 0)
9914
9915 viewbox_width = dimension_data.width;
9916 viewbox_height = dimension_data.height;
9917#endif 9904#endif
9905 {
9906 /* The functions used above to get the geometry of the visible
9907 area of the SVG are only available in librsvg 2.46 and above,
9908 so in certain circumstances this code path can result in some
9909 parts of the SVG being cropped. */
9910 RsvgDimensionData dimension_data;
9918 9911
9919 if (viewbox_width == 0 || viewbox_height == 0) 9912 rsvg_handle_get_dimensions (rsvg_handle, &dimension_data);
9920 { 9913
9921 /* We do not have any usable dimensions, so make some up. The 9914 viewbox_width = dimension_data.width;
9922 values below are supposedly the default values most web 9915 viewbox_height = dimension_data.height;
9923 browsers use for SVGs with no set size. */ 9916 }
9924 /* FIXME: At this stage we should perhaps consider rendering the
9925 image out to a bitmap and getting the dimensions from
9926 that. */
9927 viewbox_width = 300;
9928 viewbox_height = 150;
9929 }
9930 9917
9931 compute_image_size (viewbox_width, viewbox_height, img->spec, 9918 compute_image_size (viewbox_width, viewbox_height, img->spec,
9932 &width, &height); 9919 &width, &height);
diff --git a/src/keyboard.c b/src/keyboard.c
index 49a0a8bd236..49261fcc3e8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2122,7 +2122,7 @@ read_char_help_form_unwind (void)
2122 Lisp_Object window_config = XCAR (help_form_saved_window_configs); 2122 Lisp_Object window_config = XCAR (help_form_saved_window_configs);
2123 help_form_saved_window_configs = XCDR (help_form_saved_window_configs); 2123 help_form_saved_window_configs = XCDR (help_form_saved_window_configs);
2124 if (!NILP (window_config)) 2124 if (!NILP (window_config))
2125 Fset_window_configuration (window_config); 2125 Fset_window_configuration (window_config, Qnil);
2126} 2126}
2127 2127
2128#define STOP_POLLING \ 2128#define STOP_POLLING \
@@ -3736,9 +3736,6 @@ discard_mouse_events (void)
3736 if (sp->kind == MOUSE_CLICK_EVENT 3736 if (sp->kind == MOUSE_CLICK_EVENT
3737 || sp->kind == WHEEL_EVENT 3737 || sp->kind == WHEEL_EVENT
3738 || sp->kind == HORIZ_WHEEL_EVENT 3738 || sp->kind == HORIZ_WHEEL_EVENT
3739#ifdef HAVE_GPM
3740 || sp->kind == GPM_CLICK_EVENT
3741#endif
3742 || sp->kind == SCROLL_BAR_CLICK_EVENT 3739 || sp->kind == SCROLL_BAR_CLICK_EVENT
3743 || sp->kind == HORIZONTAL_SCROLL_BAR_CLICK_EVENT) 3740 || sp->kind == HORIZONTAL_SCROLL_BAR_CLICK_EVENT)
3744 { 3741 {
@@ -5542,9 +5539,6 @@ make_lispy_event (struct input_event *event)
5542 /* A mouse click. Figure out where it is, decide whether it's 5539 /* A mouse click. Figure out where it is, decide whether it's
5543 a press, click or drag, and build the appropriate structure. */ 5540 a press, click or drag, and build the appropriate structure. */
5544 case MOUSE_CLICK_EVENT: 5541 case MOUSE_CLICK_EVENT:
5545#ifdef HAVE_GPM
5546 case GPM_CLICK_EVENT:
5547#endif
5548#ifndef USE_TOOLKIT_SCROLL_BARS 5542#ifndef USE_TOOLKIT_SCROLL_BARS
5549 case SCROLL_BAR_CLICK_EVENT: 5543 case SCROLL_BAR_CLICK_EVENT:
5550 case HORIZONTAL_SCROLL_BAR_CLICK_EVENT: 5544 case HORIZONTAL_SCROLL_BAR_CLICK_EVENT:
@@ -5559,11 +5553,7 @@ make_lispy_event (struct input_event *event)
5559 position = Qnil; 5553 position = Qnil;
5560 5554
5561 /* Build the position as appropriate for this mouse click. */ 5555 /* Build the position as appropriate for this mouse click. */
5562 if (event->kind == MOUSE_CLICK_EVENT 5556 if (event->kind == MOUSE_CLICK_EVENT)
5563#ifdef HAVE_GPM
5564 || event->kind == GPM_CLICK_EVENT
5565#endif
5566 )
5567 { 5557 {
5568 struct frame *f = XFRAME (event->frame_or_window); 5558 struct frame *f = XFRAME (event->frame_or_window);
5569 int row, column; 5559 int row, column;
diff --git a/src/keymap.c b/src/keymap.c
index 181dcdad3ad..e22eb411f63 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3085,6 +3085,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3085 for (i = from; ; i++) 3085 for (i = from; ; i++)
3086 { 3086 {
3087 bool this_shadowed = 0; 3087 bool this_shadowed = 0;
3088 Lisp_Object shadowed_by = Qnil;
3088 int range_beg, range_end; 3089 int range_beg, range_end;
3089 Lisp_Object val; 3090 Lisp_Object val;
3090 3091
@@ -3127,11 +3128,9 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3127 /* If this binding is shadowed by some other map, ignore it. */ 3128 /* If this binding is shadowed by some other map, ignore it. */
3128 if (!NILP (shadow)) 3129 if (!NILP (shadow))
3129 { 3130 {
3130 Lisp_Object tem; 3131 shadowed_by = shadow_lookup (shadow, kludge, Qt, 0);
3131
3132 tem = shadow_lookup (shadow, kludge, Qt, 0);
3133 3132
3134 if (!NILP (tem)) 3133 if (!NILP (shadowed_by) && !EQ (shadowed_by, definition))
3135 { 3134 {
3136 if (mention_shadow) 3135 if (mention_shadow)
3137 this_shadowed = 1; 3136 this_shadowed = 1;
@@ -3186,6 +3185,21 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3186 && !NILP (Fequal (tem2, definition))) 3185 && !NILP (Fequal (tem2, definition)))
3187 i++; 3186 i++;
3188 3187
3188 /* Make sure found consecutive keys are either not shadowed or,
3189 if they are, that they are shadowed by the same command. */
3190 if (CHAR_TABLE_P (vector) && i != starting_i)
3191 {
3192 Lisp_Object tem;
3193 Lisp_Object key = make_nil_vector (1);
3194 for (int j = starting_i + 1; j <= i; j++)
3195 {
3196 ASET (key, 0, make_fixnum (j));
3197 tem = shadow_lookup (shadow, key, Qt, 0);
3198 if (NILP (Fequal (tem, shadowed_by)))
3199 i = j - 1;
3200 }
3201 }
3202
3189 /* If we have a range of more than one character, 3203 /* If we have a range of more than one character,
3190 print where the range reaches to. */ 3204 print where the range reaches to. */
3191 3205
@@ -3209,7 +3223,13 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3209 if (this_shadowed) 3223 if (this_shadowed)
3210 { 3224 {
3211 SET_PT (PT - 1); 3225 SET_PT (PT - 1);
3212 insert_string (" (binding currently shadowed)"); 3226 static char const fmt[] = " (currently shadowed by `%s')";
3227 USE_SAFE_ALLOCA;
3228 char *buffer = SAFE_ALLOCA (sizeof fmt +
3229 SBYTES (SYMBOL_NAME (shadowed_by)));
3230 esprintf (buffer, fmt, SDATA (SYMBOL_NAME (shadowed_by)));
3231 insert_string (buffer);
3232 SAFE_FREE();
3213 SET_PT (PT + 1); 3233 SET_PT (PT + 1);
3214 } 3234 }
3215 } 3235 }
diff --git a/src/minibuf.c b/src/minibuf.c
index c4adca15365..464e3018f7d 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -501,14 +501,15 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
501 record_unwind_protect_void (choose_minibuf_frame); 501 record_unwind_protect_void (choose_minibuf_frame);
502 502
503 record_unwind_protect (restore_window_configuration, 503 record_unwind_protect (restore_window_configuration,
504 Fcurrent_window_configuration (Qnil)); 504 Fcons (Qt, Fcurrent_window_configuration (Qnil)));
505 505
506 /* If the minibuffer window is on a different frame, save that 506 /* If the minibuffer window is on a different frame, save that
507 frame's configuration too. */ 507 frame's configuration too. */
508 mini_frame = WINDOW_FRAME (XWINDOW (minibuf_window)); 508 mini_frame = WINDOW_FRAME (XWINDOW (minibuf_window));
509 if (!EQ (mini_frame, selected_frame)) 509 if (!EQ (mini_frame, selected_frame))
510 record_unwind_protect (restore_window_configuration, 510 record_unwind_protect (restore_window_configuration,
511 Fcurrent_window_configuration (mini_frame)); 511 Fcons (Qt,
512 Fcurrent_window_configuration (mini_frame)));
512 513
513 /* If the minibuffer is on an iconified or invisible frame, 514 /* If the minibuffer is on an iconified or invisible frame,
514 make it visible now. */ 515 make it visible now. */
diff --git a/src/term.c b/src/term.c
index a0738594bfc..fee3b555751 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2481,7 +2481,7 @@ term_mouse_click (struct input_event *result, Gpm_Event *event,
2481{ 2481{
2482 int i, j; 2482 int i, j;
2483 2483
2484 result->kind = GPM_CLICK_EVENT; 2484 result->kind = MOUSE_CLICK_EVENT;
2485 for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 ) 2485 for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 )
2486 { 2486 {
2487 if (event->buttons & j) { 2487 if (event->buttons & j) {
@@ -2567,11 +2567,11 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event)
2567 { 2567 {
2568 f->mouse_moved = 0; 2568 f->mouse_moved = 0;
2569 term_mouse_click (&ie, event, f); 2569 term_mouse_click (&ie, event, f);
2570 /* eassert (ie.kind == GPM_CLICK_EVENT); */ 2570 /* eassert (ie.kind == MOUSE_CLICK_EVENT); */
2571 if (tty_handle_tab_bar_click (f, event->x, event->y, 2571 if (tty_handle_tab_bar_click (f, event->x, event->y,
2572 (ie.modifiers & down_modifier) != 0, &ie)) 2572 (ie.modifiers & down_modifier) != 0, &ie))
2573 { 2573 {
2574 /* eassert (ie.kind == GPM_CLICK_EVENT 2574 /* eassert (ie.kind == MOUSE_CLICK_EVENT
2575 * || ie.kind == TAB_BAR_EVENT); */ 2575 * || ie.kind == TAB_BAR_EVENT); */
2576 /* tty_handle_tab_bar_click stores 2 events in the event 2576 /* tty_handle_tab_bar_click stores 2 events in the event
2577 queue, so we are done here. */ 2577 queue, so we are done here. */
@@ -2581,7 +2581,7 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event)
2581 count += 2; 2581 count += 2;
2582 return count; 2582 return count;
2583 } 2583 }
2584 /* eassert (ie.kind == GPM_CLICK_EVENT); */ 2584 /* eassert (ie.kind == MOUSE_CLICK_EVENT); */
2585 kbd_buffer_store_event (&ie); 2585 kbd_buffer_store_event (&ie);
2586 count++; 2586 count++;
2587 } 2587 }
diff --git a/src/termhooks.h b/src/termhooks.h
index 6ab06ceff94..44ab14225fd 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -220,10 +220,6 @@ enum event_kind
220 save yourself before shutdown. */ 220 save yourself before shutdown. */
221 SAVE_SESSION_EVENT 221 SAVE_SESSION_EVENT
222 222
223#ifdef HAVE_GPM
224 , GPM_CLICK_EVENT
225#endif
226
227#ifdef HAVE_DBUS 223#ifdef HAVE_DBUS
228 , DBUS_EVENT 224 , DBUS_EVENT
229#endif 225#endif
diff --git a/src/w32term.c b/src/w32term.c
index e0618e4f52d..23cb380040b 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -7165,15 +7165,21 @@ w32_initialize_display_info (Lisp_Object display_name)
7165 memset (dpyinfo, 0, sizeof (*dpyinfo)); 7165 memset (dpyinfo, 0, sizeof (*dpyinfo));
7166 7166
7167 dpyinfo->name_list_element = Fcons (display_name, Qnil); 7167 dpyinfo->name_list_element = Fcons (display_name, Qnil);
7168 static char const title[] = "GNU Emacs";
7168 if (STRINGP (Vsystem_name)) 7169 if (STRINGP (Vsystem_name))
7169 { 7170 {
7170 dpyinfo->w32_id_name = xmalloc (SCHARS (Vinvocation_name) 7171 static char const at[] = " at ";
7171 + SCHARS (Vsystem_name) + 2); 7172 ptrdiff_t nbytes = sizeof (title) + sizeof (at);
7172 sprintf (dpyinfo->w32_id_name, "%s@%s", 7173 if (INT_ADD_WRAPV (nbytes, SCHARS (Vsystem_name), &nbytes))
7173 SDATA (Vinvocation_name), SDATA (Vsystem_name)); 7174 memory_full (SIZE_MAX);
7175 dpyinfo->w32_id_name = xmalloc (nbytes);
7176 sprintf (dpyinfo->w32_id_name, "%s%s%s", title, at, SDATA (Vsystem_name));
7174 } 7177 }
7175 else 7178 else
7176 dpyinfo->w32_id_name = xlispstrdup (Vinvocation_name); 7179 {
7180 dpyinfo->w32_id_name = xmalloc (sizeof (title));
7181 strcpy (dpyinfo->w32_id_name, title);
7182 }
7177 7183
7178 /* Default Console mode values - overridden when running in GUI mode 7184 /* Default Console mode values - overridden when running in GUI mode
7179 with values obtained from system metrics. */ 7185 with values obtained from system metrics. */
diff --git a/src/window.c b/src/window.c
index a6de34f3db6..6cd3122b43b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6824,19 +6824,25 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config
6824} 6824}
6825 6825
6826DEFUN ("set-window-configuration", Fset_window_configuration, 6826DEFUN ("set-window-configuration", Fset_window_configuration,
6827 Sset_window_configuration, 1, 1, 0, 6827 Sset_window_configuration, 1, 2, 0,
6828 doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION. 6828 doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION.
6829CONFIGURATION must be a value previously returned 6829CONFIGURATION must be a value previously returned
6830by `current-window-configuration' (which see). 6830by `current-window-configuration' (which see).
6831
6832Normally, this function selects the frame of the CONFIGURATION, but if
6833DONT-SET-FRAME is non-nil, it leaves selected the frame which was
6834current at the start of the function.
6835
6831If CONFIGURATION was made from a frame that is now deleted, 6836If CONFIGURATION was made from a frame that is now deleted,
6832only frame-independent values can be restored. In this case, 6837only frame-independent values can be restored. In this case,
6833the return value is nil. Otherwise the value is t. */) 6838the return value is nil. Otherwise the value is t. */)
6834 (Lisp_Object configuration) 6839 (Lisp_Object configuration, Lisp_Object dont_set_frame)
6835{ 6840{
6836 register struct save_window_data *data; 6841 register struct save_window_data *data;
6837 struct Lisp_Vector *saved_windows; 6842 struct Lisp_Vector *saved_windows;
6838 Lisp_Object new_current_buffer; 6843 Lisp_Object new_current_buffer;
6839 Lisp_Object frame; 6844 Lisp_Object frame;
6845 Lisp_Object old_frame = selected_frame;
6840 struct frame *f; 6846 struct frame *f;
6841 ptrdiff_t old_point = -1; 6847 ptrdiff_t old_point = -1;
6842 USE_SAFE_ALLOCA; 6848 USE_SAFE_ALLOCA;
@@ -7153,7 +7159,10 @@ the return value is nil. Otherwise the value is t. */)
7153 select_window above totally superfluous; it still sets f's 7159 select_window above totally superfluous; it still sets f's
7154 selected window. */ 7160 selected window. */
7155 if (FRAME_LIVE_P (XFRAME (data->selected_frame))) 7161 if (FRAME_LIVE_P (XFRAME (data->selected_frame)))
7156 do_switch_frame (data->selected_frame, 0, 0, Qnil); 7162 do_switch_frame (NILP (dont_set_frame)
7163 ? data->selected_frame
7164 : old_frame
7165 , 0, 0, Qnil);
7157 } 7166 }
7158 7167
7159 FRAME_WINDOW_CHANGE (f) = true; 7168 FRAME_WINDOW_CHANGE (f) = true;
@@ -7187,11 +7196,13 @@ the return value is nil. Otherwise the value is t. */)
7187 return FRAME_LIVE_P (f) ? Qt : Qnil; 7196 return FRAME_LIVE_P (f) ? Qt : Qnil;
7188} 7197}
7189 7198
7190
7191void 7199void
7192restore_window_configuration (Lisp_Object configuration) 7200restore_window_configuration (Lisp_Object configuration)
7193{ 7201{
7194 Fset_window_configuration (configuration); 7202 if (CONSP (configuration))
7203 Fset_window_configuration (XCDR (configuration), XCAR (configuration));
7204 else
7205 Fset_window_configuration (configuration, Qnil);
7195} 7206}
7196 7207
7197 7208
diff --git a/src/xdisp.c b/src/xdisp.c
index 2344fe70601..e49cc433308 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -22272,14 +22272,15 @@ extend_face_to_end_of_line (struct it *it)
22272 default_face->id : face->id); 22272 default_face->id : face->id);
22273 22273
22274 /* Display fill-column indicator if needed. */ 22274 /* Display fill-column indicator if needed. */
22275 /* We need to subtract 1 to the indicator_column here because we 22275 const int indicator_column = fill_column_indicator_column (it, 1);
22276 will add the indicator IN the column indicator number, not 22276
22277 after it. We compare the variable it->current_x before 22277 /* Make sure our idea of current_x is in sync with the glyphs
22278 producing the glyph. When FRAME_WINDOW_P we subtract 22278 actually in the glyph row. They might differ because
22279 CHAR_WIDTH calculating STRETCH_WIDTH for the same reason. */ 22279 append_space_for_newline can insert one glyph without
22280 const int indicator_column = 22280 updating current_x. */
22281 fill_column_indicator_column (it, 1) - 1; 22281 it->current_x = it->glyph_row->used[TEXT_AREA];
22282 do 22282
22283 while (it->current_x <= it->last_visible_x)
22283 { 22284 {
22284 if (it->current_x != indicator_column) 22285 if (it->current_x != indicator_column)
22285 PRODUCE_GLYPHS (it); 22286 PRODUCE_GLYPHS (it);
@@ -22297,7 +22298,6 @@ extend_face_to_end_of_line (struct it *it)
22297 it->c = it->char_to_display = ' '; 22298 it->c = it->char_to_display = ' ';
22298 } 22299 }
22299 } 22300 }
22300 while (it->current_x <= it->last_visible_x);
22301 22301
22302 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 22302 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
22303 && (it->glyph_row->used[RIGHT_MARGIN_AREA] 22303 && (it->glyph_row->used[RIGHT_MARGIN_AREA]
diff --git a/src/xterm.c b/src/xterm.c
index 98bb0ea8917..0d2452de929 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12928,19 +12928,23 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
12928#endif 12928#endif
12929 12929
12930 Lisp_Object system_name = Fsystem_name (); 12930 Lisp_Object system_name = Fsystem_name ();
12931 12931 static char const title[] = "GNU Emacs";
12932 ptrdiff_t nbytes = SBYTES (Vinvocation_name) + 1;
12933 if (STRINGP (system_name)
12934 && INT_ADD_WRAPV (nbytes, SBYTES (system_name) + 1, &nbytes))
12935 memory_full (SIZE_MAX);
12936 dpyinfo->x_id = ++x_display_id;
12937 dpyinfo->x_id_name = xmalloc (nbytes);
12938 char *nametail = lispstpcpy (dpyinfo->x_id_name, Vinvocation_name);
12939 if (STRINGP (system_name)) 12932 if (STRINGP (system_name))
12940 { 12933 {
12941 *nametail++ = '@'; 12934 static char const at[] = " at ";
12942 lispstpcpy (nametail, system_name); 12935 ptrdiff_t nbytes = sizeof (title) + sizeof (at);
12936 if (INT_ADD_WRAPV (nbytes, SBYTES (system_name), &nbytes))
12937 memory_full (SIZE_MAX);
12938 dpyinfo->x_id_name = xmalloc (nbytes);
12939 sprintf (dpyinfo->x_id_name, "%s%s%s", title, at, SDATA (system_name));
12943 } 12940 }
12941 else
12942 {
12943 dpyinfo->x_id_name = xmalloc (sizeof (title));
12944 strcpy (dpyinfo->x_id_name, title);
12945 }
12946
12947 dpyinfo->x_id = ++x_display_id;
12944 12948
12945 /* Figure out which modifier bits mean what. */ 12949 /* Figure out which modifier bits mean what. */
12946 x_find_modifier_meanings (dpyinfo); 12950 x_find_modifier_meanings (dpyinfo);