1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-07 06:22:32 -08:00
Commit graph

50780 commits

Author SHA1 Message Date
Eli Zaretskii
0026445dd6 Fix MinGW build broken by integration of 'stdio-consolesafe'
* src/conf_post.h: Avoid redirecting '*printf' functions if
'OMIT_CONSOLESAFE' is defined to 1.
* nt/cmdproxy.c:
* nt/ddeclient.c: Define 'OMIT_CONSOLESAFE' to 1 to avoid
redirecting '*printf functions' to stdio-consolesafe replacements.
* nt/Makefile.in (LIBS_ADDPM): Add -lgnu to link 'addpm' against
Gnulib.  (Bug#79855)
2025-11-18 16:19:20 +02:00
Eli Zaretskii
364b5306c0 Fix last change in keyboard.c
* src/keyboard.c (adjust_point_for_property): Handle 'display'
property on the same text as 'invisible' property the same as the
overlay with a 'display' property.  (Bug#79787)
2025-11-16 17:17:37 +02:00
Eli Zaretskii
3888979ee1 Fix cursor motion across invisible text with an overlay
* src/keyboard.c (adjust_point_for_property): Handle the case
where invisible text has an overlay over it with a replacing
'display' property, which leaves some "trace" of the invisible
text on display.  (Bug#79787)
2025-11-16 16:38:37 +02:00
Eli Zaretskii
2ab07033ea Workaround for MSVCRT stdio on MS-Windows for CJK locales
MSVCRT implementation of stdio functions which output
characters one by one fails for CJK double-byte encodings.
Gnulib provides replacement functions which work around
those bugs.  This change makes Emacs and lib-src programs
use the replacements when Emacs is linked against MSVCRT.
* src/conf_post.h (fwrite, fprintf, printf, vfprintf, vprintf)
[WINDOWSNT]: Redirect to Gnulib replacements when Emacs is linked
against MSVCRT (as opposed to UCRT).  Suggested by Bruno Haible
<bruno@clisp.org>.
2025-11-16 09:36:03 +02:00
Eli Zaretskii
28f0658d8f Fix processing sub-process exit when keyboard input is pending
* src/process.c (wait_reading_process_output): Process status
changes of sub-processes when called with read_kbd zero and some
"keyboard input" is available, but no output from any sub-process.
(Bug#79777)
2025-11-15 19:48:08 +02:00
Eli Zaretskii
fd5e3b123e Avoid extra newline in user-error logged in *Messages*
* src/xdisp.c (reset_message_log_need_newline): New function.
* src/lisp.h: Add prototype of 'reset_message_log_need_newline'.
* src/print.c (print_error_message): Call
'reset_message_log_need_newline' to prevent message3 from
outputting a newline after "user-error:".  (Bug#79840)
2025-11-15 19:29:20 +02:00
Sean Whitton
5e819f76dc read_key_sequence: Additional check for fix_current_buffer
* src/keyboard.c (read_key_sequence): If we were interrupted
while initializing the terminal, also check for a change of
current buffer (bug#79513).
2025-11-13 17:17:34 +00:00
Po Lu
45a82437a3 Merge from savannah/emacs-30
ca4af1768d Fix crash on Android 2.2
2025-11-12 01:14:37 +08:00
Po Lu
ca4af1768d Fix crash on Android 2.2
* src/android-asset.h (AAssetManager_open): Initialize desc and
asset to NULL, lest `desc' be accessed uninitialized if C_NAME
does not exist in the directory tree.
2025-11-12 01:13:46 +08:00
Eli Zaretskii
79e1226238 * src/w32fns.c (Fw32_system_idle_time): New function. 2025-11-09 18:52:32 +02:00
Eli Zaretskii
f11349ea1a Fix a crash in 'merge_face_ref'
* src/xfaces.c (get_lface_attributes): Avoid crashes if F is NULL.
This happens when 'face_inheritance_cycle' is for some reason
called for the default attributes of a face (which are applicable
to future frames).  We avoid the crashes by not consulting face
remapping in that case, since face remapping is buffer-local, and
therefore cannot possibly affect face defaults.  (Bug#79790)
2025-11-09 08:58:15 +02:00
Eli Zaretskii
2aff4fed69 ; Fix doc strings of the various 'insert-*' functions
* src/editfns.c (Finsert_before_markers)
(Finsert_and_inherit_before_markers, Finsert_char, Finsert_byte)
(Finsert_buffer_substring): Clarify the effect on markers.
(Bug#79692)
2025-11-08 13:09:36 +02:00
Stefan Monnier
02253b35af (load-history, lisp-directory): Don't file-truename
This fixes problems in some cases of out-f-tree builds
(bug#79694, bug#62099, bug#64806).

The use of true names in `load-history` dates back to to commits
33d74677e7 and 6bb6da3ec1 by Alan Mackenzie <acm@muc.de> in
May 24 2006, but that was reverted by Paul Eggert's commit
dff4f9c759 on Sep 18 2019.

* lisp/startup.el (command-line): Don't `file-truename` `lisp-directory`.
* src/lread.c (syms_of_lread) <load-history>: Adjust docstring,
to reflect the fact that the files there aren't "true names".

* doc/lispref/loading.texi (Hooks for Loading): Adjust accordingly.
Also massage the text to reflect the fact that nowadays features are
more common than file names as arguments to `with-eval-after-load`.
2025-11-05 15:12:50 -05:00
Po Lu
240355949e Fix the Android port
* configure.ac (gl_cv_onwards_func_tzalloc): Don't disable on
Android SDK 35.

* src/conf_post.h (tzalloc): Don't override Gnulib-selected
identifier on Android SDK 35.
2025-11-05 10:32:52 +08:00
Po Lu
abcc099c73 Fix the MS-DOS port and reading of symlink targets
* doc/misc/eglot.texi (Eglot Features): Add comma after @xref.

* msdos/sed2v2.inp (GNULIB_ISSYMLINK): Define to 1.

* msdos/sedlibmk.inp (HAVE_RANDOM_H): Undefine, in line with its
deletion from gnulib.mk.
(GL_GNULIB_STRINGEQ): Define to 1.

* src/msdos.c (careadlinkat): NULL terminate at the end of the
data written, not one character beyond the same.
2025-11-05 10:06:23 +08:00
Paul Eggert
6ab56a31a5 Simplify tzfree use
* src/timefns.c (Fdecode_time, Fencode_time)
(Fcurrent_time_string): Do not bother to preserve errno around
tzfree calls, as Gnulib now does that for us.
2025-11-04 13:32:58 -08:00
Paul Eggert
59fbaca6b9 Update from Gnulib by running admin/merge-gnulib
* admin/merge-gnulib (GNULIB_MODULES): Add stringeq.
With current Gnulib it is already present as in indirect dependency;
listing it here because Emacs now depends on it directly.
* lib-src/ebrowse.c, lib-src/etags.c:
(streq): Remove, as Gnulib defines this now.
* lib/fseterr.c, lib/fseterr.h, lib/issymlink.c, lib/issymlink.h:
* lib/issymlinkat.c, lib/stdio-consolesafe.c, lib/string.c:
* m4/fseterr.m4, m4/gettext_h.m4, m4/stringeq.m4:
New files from Gnulib.
* src/conf_post.h (tzfree) [__ANDROID_API__ >= 35]: Remove.
2025-11-04 13:32:58 -08:00
Eli Zaretskii
08c1775264 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2025-11-03 09:29:35 -05:00
Eli Zaretskii
74780575e5 Fix compilation errors in xsettings.c
* src/xsettings.c (store_config_changed_event, dpyinfo_valid)
(store_font_name_changed, store_tool_bar_style_changed): Tweak
preprocessor conditions to satisfy all builds without warnings.
2025-11-03 09:27:16 -05:00
Yuan Fu
b01435306a
Change tree-sitter query predicate names (bug#79687)
Latest tree-sitter library throws a syntax error if the
predicate names in a query don't end with question mark.  So we
made the following change:

:equal changed to :eq?
:match changed to :match?
:pred changed to :pred?

Old names are transparently converted to new names when
expanding patterns.

:match predicate can now take the regexp and the node in any
order: it'll figure out which is which automatically. This way
it works with current Emacs convention (regexp first), as well
as tree-sitter's match convention (regexp second).

* doc/lispref/parsing.texi (Pattern Matching): Update manuel to
use new predicate names.
* src/treesit.c:
(Ftreesit_pattern_expand):
(Ftreesit_query_expand):
(treesit_predicate_match):
(treesit_eval_predicates):
(syms_of_treesit): Use new predicate names.
* test/src/treesit-tests.el (treesit-query-api): Update test.
2025-11-02 17:11:55 -08:00
Eli Zaretskii
942a21cc7e ; Fix another compilation warning in pgtkselect.c
* src/pgtkselect.c (pgtk_reply_selection_request): Remove another
unused variable.
2025-11-02 06:37:08 -05:00
Eli Zaretskii
58f2366075 Fix PGTK build without HSETTINGS, broken by recent changes
* src/xsettings.c (store_tool_bar_style_changed): Compile only
under HAVE_GSETTINGS.
(xg_get_system_dark_mode): Compile only under HAVE_GSETTINGS.
* src/gtkutil.c (xg_set_gtk_theme_dark_mode)
(xg_update_dark_mode_for_all_displays, xg_set_initial_dark_mode):
Only compile when HAVE_GSETTINGS is defined.
(xg_create_frame_widgets): Call 'xg_set_initial_dark_mode' only
under HAVE_GSETTINGS.
(xg_create_frame_outer_widgets): Remove unused code.  Call
'xg_set_initial_dark_mode' only under HAVE_GSETTINGS.
* src/pgtkselect.c (pgtk_reply_selection_request): Remove unused
variable.
2025-11-02 06:33:31 -05:00
Eli Zaretskii
69b0aa2928 ; Fix documentation of a recent commit
* doc/emacs/frames.texi (Frame Commands): Document
'alter-fullscreen-frames', which is a user option.  Fix indexing.

* src/frame.c (syms_of_frame) <alter-fullscreen-frames>: Doc fix.
(Bug#79756)
2025-11-02 10:48:13 +02:00
Martin Rudalics
2c4e7a99cc Handle resizing of fullscreen frames more consistently (Bug#79704)
* src/frame.c (adjust_frame_size): Honor new option
'alter-fullscreen-frames'.
(syms_of_frame) <alter-fullscreen-frames>: New option to
maintain consistent state when attempting to resize fullscreen
frames.  Default to 'inhibit' for NS builds because these
resized the frame while leaving the 'fullscreen' parameter alone
(Bug#79704).
(syms_of_frame) <Qinhibit>: Define symbol.
* lisp/cus-start.el (standard): Add customization options for
'alter-fullscreen-frames'
* doc/lispref/frames.texi (Frame Size): Describe new option
'alter-fullscreen-frames'.
* etc/NEWS: Call out new option 'alter-fullscreen-frames'.
2025-11-02 09:24:05 +01:00
Ahmed Khanzada
dd9d1df4fa Automatically toggle between dark and light mode PGTK widgets
* src/gtkutil.h: Declare 'xg_set_gtk_theme_dark_mode',
'xg_update_dark_mode_for_all_displays',
'xg_set_initial_dark_mode'.
* src/gtkutil.c (xg_set_gtk_theme_dark_mode): Toggle PGTK dark mode.
(xg_update_dark_mode_for_all_displays): Toggle PGTK dark mode for all
displays.
(xg_set_initial_dark_mode): Determine PGTK dark mode preference and set.
(xg_create_frame_widgets): Set PGTK dark mode preference for widgets.
(xg_create_frame_outer_widgets): Set PGTK dark mode preference for outer
widgets.
* src/xsettings.h: Declare 'xg_get_system_dark_mode'.
* src/xsettings.c (something_changed_gsettingsCB): Update PGTK dark mode
setting.
(xg_get_system_dark_mode): Determine PGTK dark mode preference.
GSETTINGS_COLOR_SCHEME: Defined and set to "color-scheme".
* etc/NEWS: Document automatic dark mode toggling.
(Bug#79689)
2025-11-02 08:01:41 +02:00
Eli Zaretskii
1930598225 Avoid infinite recursion in 'face_inheritance_cycle'
* src/xfaces.c (face_inheritance_cycle)
(Finternal_set_lisp_face_attribute): Prevent infinite recursion if
a face is defined to inherit from itself (whaaat? how??!).
2025-10-31 17:24:58 +02:00
Martin Rudalics
7da7b246cf Fix a bug in Fcombine_windows
* src/window.c (window_set_parent_and_normal_sizes): New function.
(Fcombine_windows): Improve doc-string.  Use wset_... functions.
Call window_set_parent_and_normal_sizes to fix a bug where it
failed to assign new normal sizes.
(Funcombine_window): Call window_set_parent_and_normal_sizes.
2025-10-31 09:17:38 +01:00
Eli Zaretskii
55d4596dd0 ; * src/lisp.h (MAX_ALLOCA): Comment on enlarging the value. 2025-10-31 08:39:36 +02:00
Eli Zaretskii
1472f8241d ; * src/xfaces.c (face_inheritance_cycle): More defensive code. 2025-10-29 19:26:40 +02:00
Eli Zaretskii
23d8633579 Avoid face inheritance cycles
* src/xfaces.c (face_inheritance_cycle): New function.
(Finternal_set_lisp_face_attribute): Signal an error if the
':inherit' attribute of a face is modified in a way that will
cause it to inherit from itself.  (Bug#79672)

* test/src/xfaces-tests.el (xfaces-test-circular-inheritance): New
test.

* etc/NEWS: Announce the incompatible change.
2025-10-27 15:54:10 +02:00
Eli Zaretskii
42ac31133e ; Remove unintended hunks from last changeset. 2025-10-25 13:06:42 +03:00
Eli Zaretskii
f20eed46f9 ; Fix last change (bug#79629)
* lisp/calendar/holidays.el (holiday-general-holidays)
(holiday-oriental-holidays, holiday-local-holidays)
(holiday-other-holidays, holiday-hebrew-holidays)
(holiday-christian-holidays, holiday-islamic-holidays)
(holiday-bahai-holidays, holiday-solar-holidays): Doc fixes.
2025-10-25 10:38:07 +03:00
João Távora
f47824106a Prevent shorthand inheritance when loading .elc files (bug#79485)
Loading .elc files doesn't go through 'load-with-code-conversion' as
usual, but since these files are still 'read', we must still take care
to bind read-symbol-shorthands to nil around that.  The process is
simpler than in 'load-with-code-conversion' because .elc files cannot
have read-symbol-shorthands cookies, so the binding is always to nil.
If we don't do this, the symbols in the .elc will be subject to
shorthand manipulation if there's an active binding in the recursive
load stack.

* src/lread.c (readevalloop): Bind read-symbol-shorthands to nil.
(syms_of_lread): Add Qread_symbol_shorthands.
2025-10-23 22:35:32 +01:00
Pranshu Sharma
db6ac3c5f4 New commands to split and merge frames
* lisp/window-x.el (merge-frames, split-frame): New commands.
2025-10-23 10:04:39 +02:00
Eli Zaretskii
100963b492 ; * src/frame.c (frame_get): Fix a thinko. 2025-10-22 19:03:53 +03:00
Alan Mackenzie
1a75481932 Allow renaming of frames to F<num> on text terminals
This fixes bug#79649.  Creating duplicate names F<num> is
prevented, ensuring that select-frame-by-name is still
effective on text terminals.

* src/frame.c (frame_get, frame_next_F_name): New functions.
(make_terminal_frame): Use frame_next_F_name.
(set_term_frame_name): In place of disallowing F<num>, check
that the requested F<num> doesn't already exist.

* etc/NEWS (Frames): Add an entry for this amendment.
2025-10-22 12:44:34 +00:00
Mattias Engdegård
6a3d22f3a0 ; * src/lisp.h (struct Lisp_String): mention terminating NUL 2025-10-22 09:03:38 +02:00
Mattias Engdegård
498f89af2a Don't feed the stack overflow detector bad data
* src/lisp.h (record_in_backtrace): Don't record the argument address as
stack_top because most of the time it won't be on the C stack at all.
* src/eval.c (eval_sub): Do it here instead using an address guaranteed
to be on the C stack and we are just in the Lisp interpreter anyway.
2025-10-20 17:53:48 +02:00
Mattias Engdegård
04cb852c13 ; * src/bytecode.c (exec_byte_code): editing mistake (thanks Pip!) 2025-10-19 15:14:20 +02:00
Mattias Engdegård
346213f883 Disable -Wclobbered for GCC in exec_byte_code (bug#79610)
* src/bytecode.c (exec_byte_code):
Disable the -Wclobbered warning for GCC locally as the old work-around
doesn't appear to be effective for variables with explicitly assigned
registers.  This also allows us to remove that work-around which
improves the code somewhat.
2025-10-19 15:09:01 +02:00
Mattias Engdegård
076307b163 ; exec_byte_code: refactor branch case 2025-10-19 14:57:34 +02:00
Mattias Engdegård
ae673ce20c exec_byte_code: use fixed registers for top and pc (bug#79610)
GCC seems to have difficulty allocating important global interpreter
variables in registers; telling it which ones to use for 'top' and 'pc'
makes a big difference and seems to ease pressure enough for it to
deal with other variables as well.

We do it for AMD64 and ARM64.  Clang doesn't seem to need these directives.
It does result in -Wclobbered warnings that seem difficult to silence.

* src/bytecode.c (BC_REG_TOP, BC_REG_PC): New.
(exec_byte_code): Use them.
2025-10-19 14:57:34 +02:00
Mattias Engdegård
fbc68bbc36 ; exec_byte_code: don't re-use op in FETCH2 2025-10-19 14:57:34 +02:00
Mattias Engdegård
b72e352cb4 exec_byte_code: reduce use of semi-global 'op' (bug#79610)
* src/bytecode.c (exec_byte_code):
Re-type op from int to ptrdiff_t, which avoids some useless conversions.
Reduce its use by using local variables for intra-block use,
and another variable (arg) where it doesn't need to be alive across
instruction dispatch.  We also eliminate it where performance doesn't
matter by re-fetching it from the instruction stream.

All this should help the register allocator.
2025-10-19 14:57:34 +02:00
Spencer Baugh
bea16dfe69 Respect keymaps in buffer text for clicks on displayed strings
When clicking on a string displayed by a display property, also
look at the text properties of the underlying buffer text for
keymaps, not just the displayed string.  The displayed string
takes precedence over the buffer text, but it doesn't replace
it.

Also, we should use the buffer's local map even for clicks on
the mode line.  (Otherwise, what's the point of the <mode-line>
event?)

* src/keymap.c (Fcurrent_active_maps): Consider displayed
string, then buffer text, then fall back to local
map.  (Bug#79505)

* test/src/keymap-tests.el
(keymap-test-keymaps-for-non-buffer-positions): Add more tests.
2025-10-18 12:48:41 +03:00
Eli Zaretskii
0d8a31423a ; Fix documentation of a recent commit
* src/window.c (Fcombine_windows, Funcombine_window): Doc fixes.

* doc/lispref/windows.texi (Recombining Windows): Fix markup and
wording.
2025-10-18 12:26:28 +03:00
Martin Rudalics
ef2b032567 Add functions 'combine-windows' and 'uncombine-window'
* src/window.c (make_parent_window, Fcombine_windows)
(Funcombine_window): New functions.
(Fsplit_window_internal): Use make_parent_window.
* doc/lispref/windows.texi (Recombining Windows): Describe new
functions 'combine-windows' and 'uncombine-window'.
(Window Configurations): Explain "window clones".
* etc/NEWS: Mention new functions 'combine-windows' and
'uncombine-window'.
2025-10-18 10:33:10 +02:00
Przemysław Alexander Kamiński
7de5a6d1f7 Release NS objects (bug#79023)
* src/nsterm.m (ns_free_frame_resources): Release the NSView.
([EmacsView dealloc]): Release the EmacsLayer and menu.
([EmacsWindow dealloc]): Fix the toolbar release.

Co-authored-by: Rudolf Adamkovič <rudolf@adamkovic.org>
2025-10-17 19:53:38 +01:00
Eli Zaretskii
d587ce8c65 Support Tree-sitter version 0.26 and later
* src/treesit.c (init_treesit_functions)
[TREE_SITTER_LANGUAGE_VERSION >= 15]: Define prototype for, and
load 'ts_language_abi_version' instead of the deprecated (and
removed in tree-sitter 0.26) 'ts_language_version'.
(ts_language_abi_version) [TREE_SITTER_LANGUAGE_VERSION >= 15]:
Define on WINDOWSNT, instead of 'ts_language_version'.
(treesit_language_abi_version): New compatibility function.
(treesit_load_language, Ftreesit_language_abi_version): Use
'treesit_language_abi_version' instead of 'ts_language_version'.
(Bug#79627)
2025-10-17 14:15:41 +03:00
Spencer Baugh
17ac50ea9e Return case common to all completions in try-completion
When completion-ignore-case is non-nil, if all completions share
a common prefix ignoring case, try-completion has always
returned that.  Now, if all completions also share a common
prefix including case, try-completion includes that common
prefix in its return value (bug#79377).

* lisp/minibuffer.el (completion-pcm--merge-completions): Always
use return value from try-completion, which may change case.
* src/minibuf.c (Ftry_completion): Return the common prefix
which changes case.
* test/lisp/minibuffer-tests.el (completion-pcm-bug4219)
(completion-substring-test-5): New tests.
2025-10-16 20:18:23 +03:00