Commit graph

51165 commits

Author SHA1 Message Date
Sean Whitton
c7167f2a1e Merge from origin/emacs-31
c3babe4b89 Fix lax whitespace highlight during query-replace
2e70b88623 Fix fill-paragraph combining text with preceding comment
ea54c33950 ; * etc/PROBLEMS: Link to bug#81124.
02897e208d emacsclient quote_argument is void
c618178066 ; Mark process-test-stderr-buffer as :unstable when runni...
2c1b45f5c5 ; Improve documentation of 'vc-dir-auto-hide-up-to-date'
768c8bf004 Revert "* admin/notes/documentation: Recommend not using ...
a7414f1859 native--compile-skip-on-battery-p: Try to fix ?b, ?B cond...
7cee526a8c Save and restore original local keymap in grep-edit-mode
4d87d203cf Fix display of inline SVG images in Rmail
4c55d04ebe Add treesit-ready-p check back to tree-sitter major modes...
7892ae5eaf Fix pathological slowness in flex completion
12eec781ed No longer raise error on HTTP 402 (Payment Required) (bug...
1800350b18 Avoid compilation-mode matching rust as gnu
2026-05-29 11:01:25 +01:00
Eli Zaretskii
7ee3314398 Speed-up cursor motion under 'display-line-numbers-mode'
* src/xfaces.c (Finternal_lisp_face_equal_p): Accept an additional
optional argument INHERIT; if non-nil, consider two faces equal if
one inherits from the other and doesn't specify any other
attributes to be different from it.
* src/xdisp.c (try_cursor_movement, try_window_id): Call
'Finternal_lisp_face_equal_p' with non-nil INHERIT argument, to
speed up redisplay in the default case when line numbers are shown.
(Bug#81133)

* test/src/xfaces-tests.el (xfaces-test-face-equality): New test.
2026-05-28 18:36:11 +03:00
Michael Albinus
833553dd9a dbus-call-method-asynchronously supports also an ERROR-HANDLER
* doc/misc/dbus.texi (Asynchronous Methods): HANDLER can also be
(HANDLER . ERROR-HANDLER).

* etc/NEWS: Mention ERROR-HANDLER of dbus-call-method-asynchronously.

* lisp/net/dbus.el (dbus-call-method-asynchronously): Adapt docstring.
(dbus-check-event, dbus-handle-event): HANDLER can also be
(HANDLER . ERROR-HANDLER).

* src/dbusbind.c (Fdbus_message_internal): HANDLER can also be
(HANDLER . ERROR-HANDLER).  (Bug#80952)

* test/lisp/net/dbus-tests.el (dbus--test-method-another-handler)
(dbus--test-method-error-handler): New defvars.
(dbus--test-method-another-handler)
(dbus--test-method-error-handler): New functions.
(dbus-test04-call-method-error-handler): New test.
(dbus-test10-keep-fd): Extend test.
2026-05-28 10:03:05 +02:00
Po Lu
de926d281a Fix the MSDOS build
* msdos/sedlibmk.inp (GL_GNULIB_STDC_[^ =] &c.): Rename from
GL_STDC_... and define to 1 before other variables prefixed
GL_GNULIB_ are defined to 0.
(NEXT_AS_FIRST_DIRECTIVE_STDBIT_H)
(NEXT_AS_FIRST_DIRECTIVE_STDCOUNTOF_H, STDCOUNTOF_H): Define.
(GL_HAVE_STDBIT_H_CONDITION): Replace
GL_GENERATE_STDBIT_H_CONDITION.
(CXX_HAVE_STDCOUNTOF_H, GL_GNULIB_STREQ, GL_GNULIB_MEMEQ)
(GL_GNULIB_STRNUL, GL_GENERATE_STDCOUNTOF_H_CONDITION):
Substitute "1".

* src/conf_post.h (_REGEX_AVOID_UCHAR_H) [MSDOS]: Define to 1.

* src/term.c (init_tty) [MSDOS]: Set TN_max_colors to 16,
which was deleted inadvertently with recent MS Windows
modifications.

* config.bat: Rename stdcountof.in.h appropriately.
2026-05-28 12:59:55 +08:00
Paul Eggert
6728239f32 Use compound literal in lisp_h_make_fixnum_wrap
* src/lisp.h (lisp_h_make_fixnum_wrap) [USE_LSB_TAG]: Use compound
literal, not cast.  This pacifies -Wuseless-cast when building on
Fedora 44 x86-64 with ‘./configure --enable-gcc-warnings
CFLAGS='-O2 -DDEFINE_KEY_OPS_AS_MACROS'’.
2026-05-27 14:01:40 -07:00
Paul Eggert
54b6ea14a9 Port MinGW GCC 9.2 image.c fix to non MS-Windows
Avoid useless casts on GCC 14+ platforms on non MS-Windows, by
using a cast only if HAVE_NTGUI.  That cast should not provoke
-Wuseless-cast regardless of how MS-Windows defines HDC, since it
casts to an Emacs-defined type.  This change lets the code compile
again on Fedora 44 with --enable-gcc-warnings.
* src/dispextern.h (PIX_CONTAINER_TO_CONTEXT): New macro.
It defaults to the identity macro.
(Emacs_Pix_Context): Default to Emacs_Pix_Container.
* src/image.c (pbm_load, png_load_body, jpeg_load_body)
(tiff_load, gif_load, svg_load_image): Use the new macro
instead of a cast.
2026-05-27 08:37:39 -07:00
Collin Funk
967d8182cf pgtk: Fix -Wint-conversion compilation error.
* src/pgtkgui.h (WINDOW_HANDLE_UINTPTR): New macro to override the
default one in src/dispextern.h.
2026-05-27 07:59:54 -07:00
Eli Zaretskii
689448a041 Unbreak MS-Windows build broken by Gnulib sync
* src/conf_post.h: Add leading underscores to 'gl_consolesafe_*'
functions, to follow Gnulib's renaming.
* src/image.c (pbm_load, png_load_body, jpeg_load_body)
(tiff_load): Revert previous change that removed "useless" casts,
as removing them triggers warnings from MinGW GCC 9.2.
2026-05-27 16:30:23 +03:00
Paul Eggert
225876e979 ARRAYELTS → countof
C2y will standardize countof as the macro that Emacs uses the name
ARRAYELTS for.  Switch to the standard name, which is supported
by GCC 16+, by Clang 21, and by the Gnulib stdcountof-h module already
in use for compilers that do not support countof.
Also, use countof in a few places where we missed using ARRAYELTS.
* admin/coccinelle/arrayelts.cocci: Suggest countof, not ARRAYELTS.
* admin/merge-gnulib (GNULIB_MODULES): Add stdcountof-h,
as it is now a direct rather than an indirect dependency.
* exec/trace.c, src/lisp.h, src/sfnt.c: Include <stdcountof.h>.
(ARRAYELTS): Remove.  All uses replaced by countof.
* lib-src/ebrowse.c, lib-src/etags.c, lib-src/make-docfile.c:
* lib-src/seccomp-filter.c, lwlib/lwlib-Xaw.c:
Prefer <stdcountof.h> and countof to doing things by hand.
2026-05-26 21:57:20 -07:00
Paul Eggert
5d8bb14d3b Omit useless casts found by GCC 16
GCC 16’s -Wuseless-cast warning can be useful.
Fix the useless casts it identifies, and also fix false positives
by using compound literals, which are safer anyway than casts.
* src/composite.c (composition_adjust_point)
(Ffind_composition_internal):
* lwlib/xlwmenu.c (xlwMenuResources, xlwMenuClassRec)
(resource_widget_value, XlwMenuDestroy, Select):
* src/alloc.c (process_mark_stack):
* src/data.c (Faref):
* src/emacs-module.c (module_extract_big_integer):
* src/fileio.c (Finsert_file_contents):
* src/frame.h (FRAME_MESSAGE_BUF_SIZE):
* src/gtkutil.c (xg_tool_item_stale_p, update_frame_tool_bar):
* src/image.c (pbm_load, png_load_body, jpeg_load_body)
(tiff_load, gif_load):
* src/pdumper.c (ptrdiff_t_to_dump_off, dump_queue_dequeue)
(field_relpos, dump_field_emacs_ptr)
(dump_object_start_pseudovector, pdumper_remember_scalar_impl)
(pdumper_load, syms_of_pdumper):
* src/regex-emacs.c (BUF_PUSH, BUF_PUSH_2, POINTER_TO_OFFSET):
* src/xdisp.c (remember_mouse_glyph, pint2str):
* src/xterm.c (cvt_string_to_pixel, handle_one_xevent):
Omit useless casts.  Perhaps they were formerly needed,
but they should not be needed now.
* src/alloc.c (Fmemory_info):
* src/category.c (Fdefine_category, Fmodify_category_entry):
* src/data.c (Fash):
* src/dispextern.h (GLYPH_CODE_P):
* src/emacs.c (load_seccomp):
* src/fns.c (Flocale_info, maybe_resize_hash_table):
* src/indent.c (check_display_width):
* src/json.c (symset_size):
* src/lisp.h (XUNTAG, BOOL_VECTOR_LENGTH_MAX, obarray_size)
(hash_table_index_size):
* src/lread.c (make_obarray, grow_obarray, Fobarray_clear):
* src/menu.c (digest_single_submenu, x_popup_menu_1):
* src/term.c (init_tty):
* src/widget.c (update_wm_hints):
* src/xdisp.c (truncate_echo_area):
* src/xfns.c (x_set_border_pixel):
* src/xfont.c (xfont_match, xfont_open):
* src/xmenu.c (set_frame_menubar):
* test/src/emacs-module-resources/mod-test.c (emacs_module_init):
Use compound literal instead of a cast that is useless in
some platforms but not others.
* src/dispextern.h, src/haikugui.h, src/w32gui.h:
(WINDOW_HANDLE_UINTPTR): New macro.
* src/frame.c (gui_report_frame_params):
* src/xterm.c (x_try_cr_xlib_drawable):
Use it.
* src/lisp.h (XUNTAG): And tag with UINTPTR_MAX to pacify
gcc warning about a constant out of range.
(hash_idx_t): Make it int_least32_t, as it need not be exactly 32 bits.
(PRIdHASH_IDX): New macro.
* src/pdumper.c (dump_queue_dequeue): Use it.
* src/profiler.c (setup_cpu_timer): Make a local EMACS_INT
rather than int, to avoid need for casting later.
* src/syntax.c (uninitialized_interval):
Use 1u rather than 1 so the cast is always useful.
A compound literal wouldn’t do here, as this macro
needs to be an integer constant expression.
* src/xfns.c (XICCallback, XICProc): Remove macros.
(Xxic_preedit_start_callback): Use a cleaner way to specify it,
avoiding the need for type macros, and for a cast
if HAVE_XICCALLBACK_CALLBACK.
* src/xterm.c (handle_one_xevent): 2nd arg is now XEvent *
on all platforms, as there is no need to diverge, and
diverging meant we needed lots of unnecessary casts.
2026-05-26 21:57:19 -07:00
Pip Cet
25fb3f9b46 Fix self-insert-command in multibyte buffers (bug#81129)
* src/cmds.c (internal_self_insert): Pass PT_BYTE to FETCH_BYTE, not
PT.
2026-05-26 14:10:16 +00:00
Eli Zaretskii
ea2110b6e5 ; * src/sfntfont-android.c (GET_SCANLINE_BUFFER): Fix a typo. 2026-05-25 18:39:26 +03:00
Po Lu
6d15d68e1f ; * src/sfntfont-android.c (GET_SCANLINE_BUFFER): Correct commentary. 2026-05-25 11:50:03 +08:00
Po Lu
d6215451fa Fix parsing of font metadata tables on Android
* src/sfnt.c (sfnt_read_meta_table): Allocate
`directory->length' bytes after the map rather than in place of
it.
2026-05-25 11:29:32 +08:00
Po Lu
7cef362581 Fix the Android build
* src/sfnt.c (sfnt_fill_span) [NDEBUG]: Don't access `row_end'
when not defined.
2026-05-25 11:23:30 +08:00
Pip Cet
b72dcebdab Avoid crash in self-insert-command with non-ASCII auto-fill
* src/cmds.c (internal_self_insert): If the autofill function changed
the newline character we inserted, don't attempt to restore point.
* test/src/cmds-tests.el (self-insert-nonascii-autofill): New.
2026-05-24 12:32:28 +00:00
Pip Cet
7f8ac8bf6f Avoid crash in self-insert-command for peculiar arguments
* src/cmds.c (internal_self_insert): Don't call auto-fill-function
after inserting zero newlines.
* test/src/cmds-tests.el (self-insert-zero-newlines): New.
2026-05-24 11:51:38 +00:00
Pip Cet
94dbab2fe4 Fix 'do_casify_natnum' for events with all flags set
* src/casefiddle.c (do_casify_natnum): Extend range a little, to cover
character events with all modifier flags set.
* test/src/casefiddle-tests.el (casefiddle-allflags): New test.
2026-05-24 10:11:33 +00:00
Pip Cet
c146e3643c Fix off-by-one error in 'styled_format'
This would (rarely) result in composition properties being shared
across the concatenation of two copies of a string.

* src/editfns.c (styled_format): Include the first argument in the
range.
* test/src/editfns-tests.el (editfns-tests--format-composition-property):
New.
2026-05-24 09:23:05 +00:00
Yuan Fu
6932c940fd
Fold calls to fix_position into treesit_check_position (bug#80830)
* src/treesit.c (treesit_check_position): Return the validated
value.
(Ftreesit_node_first_child_for_pos):
(Ftreesit_node_descendant_for_range):
(Ftreesit_query_capture):
(Ftreesit__linecol_at): Fold calls to fix_position into
treesit_check_position in treesit.c.
2026-05-23 22:55:31 -07:00
João Távora
7892ae5eaf Fix pathological slowness in flex completion
The 'completion-regexp-list' optimization in
completion--flex-all-completions-1, a cheap pre-filter via a trivial
regexp, performs very poorly for longer patterns and strings, so drop
it.  That alone recovers fairly decent performance for the flex
completion when compared to the 'hotfuzz' point of reference.

We then recover the cheap rejection with an O(N+M) pre-check in the
Fcompletion__flex_cost_gotoh C scorer.  This kicks in the common case
(completion-ignore-case is nil) and pays off especially when the table
is already a list and 'all-completions' needn't cons.

See:
  https://lists.gnu.org/archive/html/emacs-devel/2026-04/msg01081.html
  https://lists.gnu.org/archive/html/emacs-devel/2026-05/msg00519.html

* lisp/minibuffer.el (completion--flex-all-completions-1): Remove
regexp pre-filter.

* src/minibuf.c (Fcompletion__flex_cost_gotoh): Add subsequence
pre-check.
2026-05-24 04:23:51 +01:00
Paul Eggert
e7a333f18e EVENT_INIT via a compound literal
This pacifies GCC 16.1.1 x86-64 -Warray-bounds when compiling with
-fsanitize=address.  It’s also cleaner on more-typical platforms.
* src/termhooks.h (EVENT_INIT): Define via a compound literal
rather than via a memset plus an assignment.  This evaluates the
argument lvalue only once, and is more likely to catch type errors.
2026-05-23 19:18:54 -07:00
Paul Eggert
7bfde4d50b sfnt.c eassert vs assert
Use eassert uniformly, instead of assert.
* src/sfnt.c [!TEST]: Do not include <assert.h> or use assert.
(eassert) [TEST]: New macro.
2026-05-23 19:18:54 -07:00
Paul Eggert
c4e20777c2 Better size overflow checking for sfnt.c
* src/sfnt.c (memory_full_up) [TEST]: New static function.
(xmalloc, xcalloc, xrealloc): Use it instead of aborting.
(eassert) [TEST]: Remove; no longer needed.
(xaddmalloc, xaddrealloc): New static convenience functions.
(sfnt_read_cmap_format_12, sfnt_read_loca_table_short)
(sfnt_read_loca_table_long, sfnt_read_glyf_table)
(sfnt_read_simple_glyph, sfnt_read_compound_glyph)
(sfnt_read_glyph, sfnt_build_append, sfnt_build_outline_edges)
(sfnt_raster_glyph_outline, sfnt_build_outline_fedges)
(sfnt_raster_glyph_outline_exact, sfnt_read_hmtx_table)
(sfnt_read_name_table, sfnt_read_meta_table)
(sfnt_read_ttc_header, sfnt_read_fpgm_table)
(sfnt_read_prep_table, sfnt_create_uvs_context)
(sfnt_read_gvar_table, sfnt_read_packed_deltas)
(sfnt_vary_simple_glyph, sfnt_vary_compound_glyph):
Use the new functions to test for size overflow more reliably.
Use a cleaner way to decide whether a pointer addresses
the heap not the stack and thus needs freeing.
Fix a few more unlikely overflows.
(sfnt_read_cmap_format_12): The recently-added eassert is no
longer needed, so remove it.
(sfnt_read_simple_glyph): Initialize glyph->simple early
to simplify later code, as is done in similar functions.
Complicate size test to avoid potential unsigned overflow.
2026-05-23 19:18:54 -07:00
Paul Eggert
7e0d4fae01 Simplify sfnt.c by using long long
Even the earliest Android had plain ‘long long’,
so use that instead of doing it by hand.
* src/sfnt.c (struct sfnt_large_integer, sfnt_multiply_divide_1)
(sfnt_multiply_divide_2, sfnt_large_integer_add)
(sfnt_multiply_divide_round) [!INT64_MAX]: Remove.
(sfnt_multiply_divide, sfnt_multiply_divide_rounded)
(sfnt_mul_fixed, sfnt_mul_fixed_round, sfnt_div_fixed)
(sfnt_div_f26dot6, sfnt_mul_f26dot6, sfnt_mul_f26dot6_round)
(sfnt_mul_f2dot14, sfnt_dot_fix_14): Simplify by using long long.
2026-05-23 19:18:54 -07:00
Paul Eggert
2e91ed5f12 Prefer ptrdiff_t to size_t when either will do
Signed types are a bit safer, as they avoid some comparison confusion
and -fsanitize=undefined can check more misuses of them.
* src/alloc.c (lisp_malloc, lisp_align_malloc)
(allocate_string_data, allocate_vector_from_block, object_bytes):
* src/coding.c (from_unicode_buffer):
* src/decompress.c (acc_size, accumulate_and_process_md5):
* src/emacs.c (load_seccomp, shut_down_emacs):
* src/fns.c (sxhash_bignum):
* src/ftfont.c (get_adstyle_property):
* src/image.c (lookup_image, xpm_init_color_cache)
(xpm_cache_color):
* src/json.c (json_out_str, struct json_parser)
(json_make_object_workspace_for_slow_path)
(json_make_object_workspace_for, json_parse_array)
(json_parse_object):
* src/sysdep.c (get_current_dir_name_or_unreachable)
(init_sys_modes, convert_speed):
* src/termchar.h (struct tty_display_info):
* src/textconv.h (struct textconv_conversion_text):
* src/xfns.c (struct x_xim_text_conversion_data)
(x_encode_xim_text):
* src/xselect.c (struct transfer, c_size_for_format)
(x_size_for_format, selection_data_for_offset)
(selection_data_size, x_start_selection_transfer)
(x_continue_selection_transfer):
Prefer ptrdiff_t to size_t when either will do.
* src/term.c (Ftty__set_output_buffer_size):
Limit output buffer size to PTRDIFF_MAX as well as to SIZE_MAX.
2026-05-23 19:18:53 -07:00
Paul Eggert
82ad01b631 Fix format typos in never-executed textconv.c
* src/textconv.c (really_commit_text, really_replace_text):
Use %td not %zd.
2026-05-23 19:18:53 -07:00
Paul Eggert
fbd2f781b2 Be more careful about X selection sizes
* src/xselect.c (selection_data_for_offset):
Offset is size_t, not long, since that’s what caller passes.
(selection_data_size): Truncate large selection sizes to a value
that is more likely to work without involving undefined behavior.
Do not exceed X_ULONG_MAX which is all X can handle, or
PTRDIFF_MAX which can confuse underlying code.
(x_start_selection_transfer): Invoke selection_data_size just once.
2026-05-23 19:18:53 -07:00
Paul Eggert
1bee33c1c8 sfnt_parse_languages does not need USE_SAFE_ALLOCA
* src/sfntfont.c (sfnt_parse_languages):
Simplify so that no local array is needed.
2026-05-23 19:18:53 -07:00
Paul Eggert
ece22174e5 Omit useless android_get_image casts
* src/android.c (android_get_image):
Omit useless and confusing casts.
2026-05-23 19:18:53 -07:00
Paul Eggert
4e5103a980 Document PTRDIFF_MAX <= SIZE_MAX assumption
* src/alloc.c: New static_assert.
2026-05-23 19:18:53 -07:00
Paul Eggert
d12e8a94f7 Update src/alloc.c comments 2026-05-23 19:18:53 -07:00
Paul Eggert
19264b6912 adjust_glyph_matrix reallocation improvement
* src/dispnew.c (adjust_glyph_matrix):
Use xfree + xcalloc instead of xnrealloc + memset,
as there is no need to preserve the old contents.
2026-05-23 19:18:53 -07:00
Paul Eggert
64eb869b68 Be more careful about size multiplication
* src/alloc.c (xcalloc): New function.
* src/dispnew.c (save_current_matrix):
* src/fns.c (Finternal__hash_table_histogram):
* src/nsfns.m (Fns_display_monitor_attributes_list):
* src/pgtkfns.c (Fpgtk_display_monitor_attributes_list):
* src/pgtkselect.c (pgtk_own_selection):
* src/profiler.c (make_log):
* src/sfnt.c (sfnt_poly_edges_exact):
* src/xfns.c (x_get_monitor_attributes_xinerama)
(x_get_monitor_attributes_xrandr, Fx_display_monitor_attributes_list):
Use it instead of multiplying by hand, conceivably with overflow.
* src/profiler.c (make_log):
Check for overflow in internal size calculations.
Use xnmalloc instead of multiply + xmalloc.
* src/sfnt.c (xzalloc) [TEST]: Remove, replacing with ...
(xicalloc) [TEST]: ... this new function.  All callers changed.
(eassert) [TEST]: New macro.
* src/treesit.c (treesit_calloc_wrapper): Remove, replacing its
use with xcalloc.
2026-05-23 19:18:53 -07:00
Paul Eggert
c72e6cdc46 Avoid memsets in coding.c
* src/coding.c (detect_coding_utf_16, Fset_coding_system_priority):
Rewrite memset to initializers.
2026-05-23 19:18:53 -07:00
Paul Eggert
ced12fa114 Avoid memsets in charset.c
* src/charset.c (load_charset_map_from_file)
(load_charset_map_from_vector, Fdefine_charset_internal):
Rewrite memset to xzalloc or initializers.
2026-05-23 19:18:53 -07:00
Paul Eggert
42a8e12088 Avoid memsets in atimer.c
* src/atimer.c (start_atimer, turn_on_atimers):
Rewrite memset+assignments to xzalloc or initializers.
2026-05-23 19:18:53 -07:00
Paul Eggert
8c69ba718e Fix emit_static_object comment (no bzero call) 2026-05-23 19:18:53 -07:00
Paul Eggert
b1d338d89a Fix misleading x_dnd_begin_drag_and_drop API
* src/xterm.c (x_dnd_begin_drag_and_drop): The n_ask_actions arg
is an int, not a size_t, as XChangeProperty supports only int and
our caller passes an int.
2026-05-23 19:18:53 -07:00
Paul Eggert
4d85084509 Fix unlikely json.c size overflow calculations
* src/json.c (json_out_grow_buf)
(json_make_object_workspace_for_slow_path)
(json_byte_workspace_put_slow_path):
Use xpalloc rather than doing it by hand.
* src/json.c (json_out_grow_buf):
Change arg from needed bytes to minimum increment of bytes.
Caller changed.
2026-05-23 19:18:52 -07:00
Paul Eggert
5fd1e0bbef Coalesce load_seccomp comparisons
* src/emacs.c (load_seccomp): One comparison, not two.
2026-05-23 19:18:52 -07:00
Paul Eggert
9851c5ea34 Shrink STRING_BYTES_MAX slightly
* src/alloc.c (STRING_BYTES_MAX): Also don’t allow sizes to exceed
PTRDIFF_MAX in internal calculations when calling malloc, as those
are problematic even if the final number of bytes does not exceed
PTRDIFF_MAX.
2026-05-23 19:18:52 -07:00
Paul Eggert
59b2f8f1dc Plug default_PATH memory leak
* src/emacs.c (default_PATH): Fix very-unlikely memory leak.
2026-05-23 19:18:52 -07:00
Paul Eggert
1eb2e052bb New function memory_full_up
* src/alloc.c (memory_full_up): New function.  Replace all callers
of memory_full (SIZE_MAX) with callers to this function.
This simplifies callers and should make future changes easier.
It also saves a whopping 296 bytes in executable size
with gcc 16.1.1 20260515 (Red Hat 16.1.1-2) x86-64.
2026-05-23 19:18:52 -07:00
Eli Zaretskii
ccc94458fb Merge from origin/emacs-31
7a17f97baa Prettify special glyphs
f13287fde0 Revert "sh-script: Mark + and * as punctuation rather tha...
70b79b3ed8 Rename `icalendar-recur' type and related functions
3d2bb233f2 ; Minor Tramp changes
f6281d757d ; * etc/NEWS: Tell how to disable 'markdown-ts-mode'.
142b1e0d4c Fix Lisp injection via X-Draft-From in Gnus
d6f7b2d99b Save/restore old_buffer slot via window configurations (B...
e0fbecaf65 Adapt ert-remote-temporary-file-directory settings
3de7f0ce5e Fix warning message in 'markdown-ts-mode--initialize'
7df8604ea6 ; Improve documentation of lazy-highlight in search and r...
2936b36164 Fix "assertion 'GTK_IS_WINDOW (window)' failed"
98348a0bdc [Xt] Fix child frame resizing glitch
13b29eebc1 Eglot: use standard face for completion annotations (bug#...

# Conflicts:
#	etc/NEWS
2026-05-23 07:23:33 -04:00
Martin Rudalics
d6f7b2d99b Save/restore old_buffer slot via window configurations (Bug#81097)
With Emacs 31 the old_buffer slot of a window gets overwritten
with the buffer unshown in that window when that window is
deleted.  Fset_window_configuration triggers that when calling
delete_all_child_windows.  If a window configuration gets saved
and restored in one and the same redisplay cycle, the change
time stamps of the window and its frame will be equal and
'window-buffer-change-functions' may wrongly decide that the
window's buffer has not changed because its buffer and
old_buffer slots refer to the same buffer (Bug#81097).  Fix that
by saving and restoring the old_buffer slot.

* src/window.c (struct saved_window): Add 'old_buffer' slot.
(Fset_window_configuration): Restore old_buffer slot.
(save_window_save): Save old_buffer slot.
2026-05-22 19:33:57 +02:00
Eli Zaretskii
cda03bebfc Improve w32 implementations of 'signal' and 'raise'
* src/w32proc.c (w32_raise): A more complete, Posix-compliant
implementation.
(sys_signal): Support SIGBREAK.
* src/syssignal.h (raise): Redirect to 'w32_raise'.
* src/atimer.c: Don't redirect 'raise', now done in syssignal.h.
(Bug#80760)
2026-05-22 12:31:04 +03:00
Dmitry Gutov
2936b36164 Fix "assertion 'GTK_IS_WINDOW (window)' failed"
* src/gtkutil.c (xg_frame_set_size_and_position): Remove a
gtk_window_resize call which used a wrong value type
(GdkX11Window instead of GtkWindow).  The original motivation
for that line seems to be fixed by later changes (bug#80662).
2026-05-22 06:46:47 +03:00
Dmitry Gutov
98348a0bdc [Xt] Fix child frame resizing glitch
* src/widget.c (EmacsFrameResize): Exit early for child frames
(bug#81077).
2026-05-22 01:50:03 +03:00
Pip Cet
3131d56606 Avoid crash in doprnt
* src/doprnt.c (doprnt): Don't access string[-1].
2026-05-20 14:05:25 +00:00