diff options
| author | Andrea Corallo <akrl@sdf.org> | 2020-11-22 22:23:16 +0100 |
|---|---|---|
| committer | Andrea Corallo <akrl@sdf.org> | 2020-11-22 22:23:16 +0100 |
| commit | 033e96055cc172d8d84adc128aee7f7d9889bb00 (patch) | |
| tree | 4e6e0a24c60f4c8776fb574bf31727dcaf4af4ba /src | |
| parent | 6781cd670d1487bbf0364d80de68ca9733342769 (diff) | |
| parent | 9b6ad3107f93d40f82c3c53dc0984c6d70aded83 (diff) | |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 7 | ||||
| -rw-r--r-- | src/buffer.h | 3 | ||||
| -rw-r--r-- | src/data.c | 12 | ||||
| -rw-r--r-- | src/dispnew.c | 10 | ||||
| -rw-r--r-- | src/fns.c | 23 | ||||
| -rw-r--r-- | src/image.c | 45 | ||||
| -rw-r--r-- | src/keyboard.c | 14 | ||||
| -rw-r--r-- | src/keymap.c | 30 | ||||
| -rw-r--r-- | src/minibuf.c | 5 | ||||
| -rw-r--r-- | src/term.c | 8 | ||||
| -rw-r--r-- | src/termhooks.h | 4 | ||||
| -rw-r--r-- | src/w32term.c | 16 | ||||
| -rw-r--r-- | src/window.c | 21 | ||||
| -rw-r--r-- | src/xdisp.c | 18 | ||||
| -rw-r--r-- | src/xterm.c | 24 |
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) b->mark_ = val; } static void -bset_minor_modes (struct buffer *b, Lisp_Object val) -{ - b->minor_modes_ = val; -} -static void bset_mode_line_format (struct buffer *b, Lisp_Object val) { b->mode_line_format_ = val; @@ -1004,7 +999,6 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) bset_major_mode (b, Qfundamental_mode); bset_keymap (b, Qnil); bset_mode_name (b, QSFundamental); - bset_minor_modes (b, Qnil); /* If the standard case table has been altered and invalidated, fix up its insides first. */ @@ -5180,7 +5174,6 @@ init_buffer_once (void) bset_upcase_table (&buffer_local_flags, make_fixnum (0)); bset_case_canon_table (&buffer_local_flags, make_fixnum (0)); bset_case_eqv_table (&buffer_local_flags, make_fixnum (0)); - bset_minor_modes (&buffer_local_flags, make_fixnum (0)); bset_width_table (&buffer_local_flags, make_fixnum (0)); bset_pt_marker (&buffer_local_flags, make_fixnum (0)); 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 /* Non-nil means show ... at end of line followed by invisible lines. */ Lisp_Object selective_display_ellipses_; - /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ - Lisp_Object minor_modes_; - /* t if "self-insertion" should overwrite; `binary' if it should also overwrite newlines and tabs - for editing executables and the like. */ 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, { int offset = XBUFFER_OBJFWD (innercontents)->offset; int idx = PER_BUFFER_IDX (offset); - if (idx > 0 - && bindflag == SET_INTERNAL_SET - && !let_shadows_buffer_binding_p (sym)) - SET_PER_BUFFER_VALUE_P (buf, idx, 1); + if (idx > 0 && bindflag == SET_INTERNAL_SET + && !PER_BUFFER_VALUE_P (buf, idx)) + { + if (let_shadows_buffer_binding_p (sym)) + set_default_internal (symbol, newval, bindflag); + else + SET_PER_BUFFER_VALUE_P (buf, idx, 1); + } } 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 the corresponding frame row to be updated. */ frame_row->enabled_p = true; - /* Maybe insert a vertical border between horizontally adjacent + /* Maybe insert a vertical border between horizontally adjacent windows. */ - if (GLYPH_CHAR (right_border_glyph) != 0) + if (GLYPH_CHAR (right_border_glyph) != 0) { - struct glyph *border = window_row->glyphs[LAST_AREA] - 1; + struct glyph *border = window_row->glyphs[LAST_AREA] - 1; + /* It's a subtle bug if we are overwriting some non-char + glyph with the vertical border glyph. */ + eassert (border->type == CHAR_GLYPH); + border->type = CHAR_GLYPH; SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); } 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. */) haybytes = SBYTES (haystack) - start_byte; /* We can do a direct byte-string search if both strings have the - same multibyteness, or if at least one of them consists of ASCII - characters only. */ + same multibyteness, or if the needle consists of ASCII characters only. */ if (STRING_MULTIBYTE (haystack) ? (STRING_MULTIBYTE (needle) || SCHARS (haystack) == SBYTES (haystack) || string_ascii_p (needle)) : (!STRING_MULTIBYTE (needle) - || SCHARS (needle) == SBYTES (needle) || string_ascii_p (haystack))) - res = memmem (haystart, haybytes, - SSDATA (needle), SBYTES (needle)); - else if (STRING_MULTIBYTE (haystack)) /* unibyte needle */ + || SCHARS (needle) == SBYTES (needle))) + { + if (STRING_MULTIBYTE (haystack) && STRING_MULTIBYTE (needle) + && SCHARS (haystack) == SBYTES (haystack) + && SCHARS (needle) != SBYTES (needle)) + /* Multibyte non-ASCII needle, multibyte ASCII haystack: impossible. */ + return Qnil; + else + res = memmem (haystart, haybytes, + SSDATA (needle), SBYTES (needle)); + } + else if (STRING_MULTIBYTE (haystack)) /* unibyte non-ASCII needle */ { Lisp_Object multi_needle = string_to_multibyte (needle); res = memmem (haystart, haybytes, SSDATA (multi_needle), SBYTES (multi_needle)); } - else /* unibyte haystack, multibyte needle */ + else /* unibyte haystack, multibyte non-ASCII needle */ { /* The only possible way we can find the multibyte needle in the - unibyte stack (since we know that neither are pure-ASCII) is + unibyte stack (since we know that the needle is non-ASCII) is if they contain "raw bytes" (and no other non-ASCII chars.) */ ptrdiff_t nbytes = SBYTES (needle); 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, DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, (RsvgHandle *, const char *, const RsvgRectangle *, RsvgRectangle *, RsvgRectangle *, GError **)); -# else +# endif DEF_DLL_FN (void, rsvg_handle_get_dimensions, (RsvgHandle *, RsvgDimensionData *)); -# endif DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *)); DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *)); @@ -9604,9 +9603,8 @@ init_svg_functions (void) #if LIBRSVG_CHECK_VERSION (2, 46, 0) LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions); LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); -#else - LOAD_DLL_FN (library, rsvg_handle_get_dimensions); #endif + LOAD_DLL_FN (library, rsvg_handle_get_dimensions); LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); LOAD_DLL_FN (gdklib, gdk_pixbuf_get_width); @@ -9644,9 +9642,8 @@ init_svg_functions (void) # if LIBRSVG_CHECK_VERSION (2, 46, 0) # undef rsvg_handle_get_intrinsic_dimensions # undef rsvg_handle_get_geometry_for_layer -# else -# undef rsvg_handle_get_dimensions # endif +# undef rsvg_handle_get_dimensions # undef rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # undef g_file_new_for_path @@ -9677,9 +9674,8 @@ init_svg_functions (void) fn_rsvg_handle_get_intrinsic_dimensions # define rsvg_handle_get_geometry_for_layer \ fn_rsvg_handle_get_geometry_for_layer -# else -# define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions # endif +# define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions # define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # 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, viewbox_width = viewbox.x + viewbox.width; viewbox_height = viewbox.y + viewbox.height; } -#else - /* The function used above to get the geometry of the visible area - of the SVG are only available in librsvg 2.46 and above, so in - certain circumstances this code path can result in some parts of - the SVG being cropped. */ - RsvgDimensionData dimension_data; - rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); - - viewbox_width = dimension_data.width; - viewbox_height = dimension_data.height; + if (viewbox_width == 0 || viewbox_height == 0) #endif + { + /* The functions used above to get the geometry of the visible + area of the SVG are only available in librsvg 2.46 and above, + so in certain circumstances this code path can result in some + parts of the SVG being cropped. */ + RsvgDimensionData dimension_data; - if (viewbox_width == 0 || viewbox_height == 0) - { - /* We do not have any usable dimensions, so make some up. The - values below are supposedly the default values most web - browsers use for SVGs with no set size. */ - /* FIXME: At this stage we should perhaps consider rendering the - image out to a bitmap and getting the dimensions from - that. */ - viewbox_width = 300; - viewbox_height = 150; - } + rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); + + viewbox_width = dimension_data.width; + viewbox_height = dimension_data.height; + } compute_image_size (viewbox_width, viewbox_height, img->spec, &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) Lisp_Object window_config = XCAR (help_form_saved_window_configs); help_form_saved_window_configs = XCDR (help_form_saved_window_configs); if (!NILP (window_config)) - Fset_window_configuration (window_config); + Fset_window_configuration (window_config, Qnil); } #define STOP_POLLING \ @@ -3736,9 +3736,6 @@ discard_mouse_events (void) if (sp->kind == MOUSE_CLICK_EVENT || sp->kind == WHEEL_EVENT || sp->kind == HORIZ_WHEEL_EVENT -#ifdef HAVE_GPM - || sp->kind == GPM_CLICK_EVENT -#endif || sp->kind == SCROLL_BAR_CLICK_EVENT || sp->kind == HORIZONTAL_SCROLL_BAR_CLICK_EVENT) { @@ -5542,9 +5539,6 @@ make_lispy_event (struct input_event *event) /* A mouse click. Figure out where it is, decide whether it's a press, click or drag, and build the appropriate structure. */ case MOUSE_CLICK_EVENT: -#ifdef HAVE_GPM - case GPM_CLICK_EVENT: -#endif #ifndef USE_TOOLKIT_SCROLL_BARS case SCROLL_BAR_CLICK_EVENT: case HORIZONTAL_SCROLL_BAR_CLICK_EVENT: @@ -5559,11 +5553,7 @@ make_lispy_event (struct input_event *event) position = Qnil; /* Build the position as appropriate for this mouse click. */ - if (event->kind == MOUSE_CLICK_EVENT -#ifdef HAVE_GPM - || event->kind == GPM_CLICK_EVENT -#endif - ) + if (event->kind == MOUSE_CLICK_EVENT) { struct frame *f = XFRAME (event->frame_or_window); 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, for (i = from; ; i++) { bool this_shadowed = 0; + Lisp_Object shadowed_by = Qnil; int range_beg, range_end; Lisp_Object val; @@ -3127,11 +3128,9 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, /* If this binding is shadowed by some other map, ignore it. */ if (!NILP (shadow)) { - Lisp_Object tem; - - tem = shadow_lookup (shadow, kludge, Qt, 0); + shadowed_by = shadow_lookup (shadow, kludge, Qt, 0); - if (!NILP (tem)) + if (!NILP (shadowed_by) && !EQ (shadowed_by, definition)) { if (mention_shadow) this_shadowed = 1; @@ -3186,6 +3185,21 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, && !NILP (Fequal (tem2, definition))) i++; + /* Make sure found consecutive keys are either not shadowed or, + if they are, that they are shadowed by the same command. */ + if (CHAR_TABLE_P (vector) && i != starting_i) + { + Lisp_Object tem; + Lisp_Object key = make_nil_vector (1); + for (int j = starting_i + 1; j <= i; j++) + { + ASET (key, 0, make_fixnum (j)); + tem = shadow_lookup (shadow, key, Qt, 0); + if (NILP (Fequal (tem, shadowed_by))) + i = j - 1; + } + } + /* If we have a range of more than one character, print where the range reaches to. */ @@ -3209,7 +3223,13 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, if (this_shadowed) { SET_PT (PT - 1); - insert_string (" (binding currently shadowed)"); + static char const fmt[] = " (currently shadowed by `%s')"; + USE_SAFE_ALLOCA; + char *buffer = SAFE_ALLOCA (sizeof fmt + + SBYTES (SYMBOL_NAME (shadowed_by))); + esprintf (buffer, fmt, SDATA (SYMBOL_NAME (shadowed_by))); + insert_string (buffer); + SAFE_FREE(); SET_PT (PT + 1); } } 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, record_unwind_protect_void (choose_minibuf_frame); record_unwind_protect (restore_window_configuration, - Fcurrent_window_configuration (Qnil)); + Fcons (Qt, Fcurrent_window_configuration (Qnil))); /* If the minibuffer window is on a different frame, save that frame's configuration too. */ mini_frame = WINDOW_FRAME (XWINDOW (minibuf_window)); if (!EQ (mini_frame, selected_frame)) record_unwind_protect (restore_window_configuration, - Fcurrent_window_configuration (mini_frame)); + Fcons (Qt, + Fcurrent_window_configuration (mini_frame))); /* If the minibuffer is on an iconified or invisible frame, 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, { int i, j; - result->kind = GPM_CLICK_EVENT; + result->kind = MOUSE_CLICK_EVENT; for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 ) { if (event->buttons & j) { @@ -2567,11 +2567,11 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) { f->mouse_moved = 0; term_mouse_click (&ie, event, f); - /* eassert (ie.kind == GPM_CLICK_EVENT); */ + /* eassert (ie.kind == MOUSE_CLICK_EVENT); */ if (tty_handle_tab_bar_click (f, event->x, event->y, (ie.modifiers & down_modifier) != 0, &ie)) { - /* eassert (ie.kind == GPM_CLICK_EVENT + /* eassert (ie.kind == MOUSE_CLICK_EVENT * || ie.kind == TAB_BAR_EVENT); */ /* tty_handle_tab_bar_click stores 2 events in the event queue, so we are done here. */ @@ -2581,7 +2581,7 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) count += 2; return count; } - /* eassert (ie.kind == GPM_CLICK_EVENT); */ + /* eassert (ie.kind == MOUSE_CLICK_EVENT); */ kbd_buffer_store_event (&ie); count++; } 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 save yourself before shutdown. */ SAVE_SESSION_EVENT -#ifdef HAVE_GPM - , GPM_CLICK_EVENT -#endif - #ifdef HAVE_DBUS , DBUS_EVENT #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) memset (dpyinfo, 0, sizeof (*dpyinfo)); dpyinfo->name_list_element = Fcons (display_name, Qnil); + static char const title[] = "GNU Emacs"; if (STRINGP (Vsystem_name)) { - dpyinfo->w32_id_name = xmalloc (SCHARS (Vinvocation_name) - + SCHARS (Vsystem_name) + 2); - sprintf (dpyinfo->w32_id_name, "%s@%s", - SDATA (Vinvocation_name), SDATA (Vsystem_name)); + static char const at[] = " at "; + ptrdiff_t nbytes = sizeof (title) + sizeof (at); + if (INT_ADD_WRAPV (nbytes, SCHARS (Vsystem_name), &nbytes)) + memory_full (SIZE_MAX); + dpyinfo->w32_id_name = xmalloc (nbytes); + sprintf (dpyinfo->w32_id_name, "%s%s%s", title, at, SDATA (Vsystem_name)); } else - dpyinfo->w32_id_name = xlispstrdup (Vinvocation_name); + { + dpyinfo->w32_id_name = xmalloc (sizeof (title)); + strcpy (dpyinfo->w32_id_name, title); + } /* Default Console mode values - overridden when running in GUI mode 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 } DEFUN ("set-window-configuration", Fset_window_configuration, - Sset_window_configuration, 1, 1, 0, + Sset_window_configuration, 1, 2, 0, doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION. CONFIGURATION must be a value previously returned by `current-window-configuration' (which see). + +Normally, this function selects the frame of the CONFIGURATION, but if +DONT-SET-FRAME is non-nil, it leaves selected the frame which was +current at the start of the function. + If CONFIGURATION was made from a frame that is now deleted, only frame-independent values can be restored. In this case, the return value is nil. Otherwise the value is t. */) - (Lisp_Object configuration) + (Lisp_Object configuration, Lisp_Object dont_set_frame) { register struct save_window_data *data; struct Lisp_Vector *saved_windows; Lisp_Object new_current_buffer; Lisp_Object frame; + Lisp_Object old_frame = selected_frame; struct frame *f; ptrdiff_t old_point = -1; USE_SAFE_ALLOCA; @@ -7153,7 +7159,10 @@ the return value is nil. Otherwise the value is t. */) select_window above totally superfluous; it still sets f's selected window. */ if (FRAME_LIVE_P (XFRAME (data->selected_frame))) - do_switch_frame (data->selected_frame, 0, 0, Qnil); + do_switch_frame (NILP (dont_set_frame) + ? data->selected_frame + : old_frame + , 0, 0, Qnil); } FRAME_WINDOW_CHANGE (f) = true; @@ -7187,11 +7196,13 @@ the return value is nil. Otherwise the value is t. */) return FRAME_LIVE_P (f) ? Qt : Qnil; } - void restore_window_configuration (Lisp_Object configuration) { - Fset_window_configuration (configuration); + if (CONSP (configuration)) + Fset_window_configuration (XCDR (configuration), XCAR (configuration)); + else + Fset_window_configuration (configuration, Qnil); } 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) default_face->id : face->id); /* Display fill-column indicator if needed. */ - /* We need to subtract 1 to the indicator_column here because we - will add the indicator IN the column indicator number, not - after it. We compare the variable it->current_x before - producing the glyph. When FRAME_WINDOW_P we subtract - CHAR_WIDTH calculating STRETCH_WIDTH for the same reason. */ - const int indicator_column = - fill_column_indicator_column (it, 1) - 1; - do + const int indicator_column = fill_column_indicator_column (it, 1); + + /* Make sure our idea of current_x is in sync with the glyphs + actually in the glyph row. They might differ because + append_space_for_newline can insert one glyph without + updating current_x. */ + it->current_x = it->glyph_row->used[TEXT_AREA]; + + while (it->current_x <= it->last_visible_x) { if (it->current_x != indicator_column) PRODUCE_GLYPHS (it); @@ -22297,7 +22298,6 @@ extend_face_to_end_of_line (struct it *it) it->c = it->char_to_display = ' '; } } - while (it->current_x <= it->last_visible_x); if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 && (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) #endif Lisp_Object system_name = Fsystem_name (); - - ptrdiff_t nbytes = SBYTES (Vinvocation_name) + 1; - if (STRINGP (system_name) - && INT_ADD_WRAPV (nbytes, SBYTES (system_name) + 1, &nbytes)) - memory_full (SIZE_MAX); - dpyinfo->x_id = ++x_display_id; - dpyinfo->x_id_name = xmalloc (nbytes); - char *nametail = lispstpcpy (dpyinfo->x_id_name, Vinvocation_name); + static char const title[] = "GNU Emacs"; if (STRINGP (system_name)) { - *nametail++ = '@'; - lispstpcpy (nametail, system_name); + static char const at[] = " at "; + ptrdiff_t nbytes = sizeof (title) + sizeof (at); + if (INT_ADD_WRAPV (nbytes, SBYTES (system_name), &nbytes)) + memory_full (SIZE_MAX); + dpyinfo->x_id_name = xmalloc (nbytes); + sprintf (dpyinfo->x_id_name, "%s%s%s", title, at, SDATA (system_name)); } + else + { + dpyinfo->x_id_name = xmalloc (sizeof (title)); + strcpy (dpyinfo->x_id_name, title); + } + + dpyinfo->x_id = ++x_display_id; /* Figure out which modifier bits mean what. */ x_find_modifier_meanings (dpyinfo); |
