Commit graph

189893 commits

Author SHA1 Message Date
Helmut Eller
321020a471 * src/pdumper.c (dump_hash_table_kv): Fix for 32bit machines. 2026-02-12 09:59:55 +01:00
Helmut Eller
13027dc8f4 Add another workaround for the ephemeron pool
Disabling write barrier deferral in config.h, uncovered a second
problem: mps/test/function/eph1.c fails because segments aren't scanned
if the segment's summary doesn't intersect with the white set.

* mps/code/trace.c (traceFindGrey): Force rescanning by adding the white
set to the segments summary.
2026-02-11 09:53:40 +01:00
Helmut Eller
e34e1bc58d Add a workaround for a failing assertion
In traceScanSegRes, the assertion

  AVER(RefSetSub(ScanStateUnfixedSummary(ss), SegSummary(seg)));

can fail if we call MPS_FIX1 on a reference but not MPS_FIX2.  In a
normal Emacs session that tends to happen after ~10 minutes.  If "write
barrier deferral" is disabled in config.h, then the tests in
mps/test/function/eph1.c will also run into this assertion.

I failed to create a reproducible test with write barrier deferral
enabled.  Obvioulsy, I don't understand this issue fully.

* mps/code/poolawl.c (aephFixKey): Include the key in the SegSummary.
(aephIsWhite): Return the new reference, so that we can avoid calling
MPS_FIX2 twice.
2026-02-11 09:53:40 +01:00
Helmut Eller
53fa8e0791 Minor simplifications
* mps/test/test/testlib/ephfmt.c (make_pair, make_weak_pair): Simplify.
(eph_scan, eph_skip): Use the header.size field to skip to the next
object.
2026-02-11 09:53:40 +01:00
Helmut Eller
a4dcb8ef73 Use a helper thread to make the test more reliable
* test/src/fns-tests.el (ft-weak-equal-table): With wide-ints, the test
unexpecetly passed probably because some stray reference to '(key 0) was
on the stack.  With a helper thread, the test works as expected.
2026-02-11 08:37:32 +01:00
Helmut Eller
dc94610043 * src/igc.c (is_dflt_fwd): Avoid false positives due to exthdrs. 2026-02-08 17:16:40 +01:00
Helmut Eller
a397513082 Update struct hashes 2026-02-08 17:11:17 +01:00
Eli Zaretskii
904159b4d9 ; * src/thread.c (run_thread): Fix last change. 2026-02-07 15:53:48 +02:00
Eli Zaretskii
c364d5d99c Merge branch 'feature/igc' of git.sv.gnu.org:/srv/git/emacs into feature/igc 2026-02-07 15:53:29 +02:00
Gerd Möllmann
1ca778c86c * src/thread.c (run_thread): Do not igc_xfree handlers on macOS/arm64 2026-02-07 14:51:19 +01:00
Gerd Möllmann
661f4a0906 * src/thread.c (run_thread): Do not igc_xfree handlers on macOS/arm64 2026-02-07 15:46:11 +02:00
Eli Zaretskii
dc87175c50 ; * mps/TESTING: Make the MS-Windows part less confusing. 2026-02-07 12:32:35 +02:00
Eli Zaretskii
b0a0915b13 Fix compilation error in print.c
* src/print.c (print_object): Fix a compilation error due to
misplaced declaration.
2026-02-07 11:56:40 +02:00
Gerd Möllmann
ea2b1db679 ; Fix a compilation warning if not USE_EPHEMERON_POOL
* src/igc.c (make_pool_aeph): Put in #ifdef / #endif.
2026-02-03 06:33:25 +01:00
Helmut Eller
51f686e688 Alternative implementation for weak hash tables
It can be enabled with -DUSE_EPHEMERON_POOL.

This variant uses the ephemeron pool and hence sovles the key-in-value
problem.

This version stores key/values pairs a vector-of-pairs instead of a
pair-of-vectors.  The same vector-of-pairs type is used for weak and
non-weak.  This avoids the code duplication used by the pair-of-vector
version; though it adds a bit of overhead to the non-weak code path.

* src/lisp.h: (struct vector_pair [!USE_EPHEMERON_POOL]): New type.
(struct pair_vector [USE_EPHEMERON_POOL]):New type.
(hash_table_kv): New typedef used to both version.
(hash_table_kv_create, hash_table_kv_free, hash_table_kv_key)
(hash_table_kv_value, hash_table_kv_set_key, hash_table_kv_set_value)
(hash_table_kv_null): New helpers
(struct Lisp_Hash_Table): Use a single field kv of type hash_table_kv
instead of two fields.
(HASH_KEY, HASH_VALUE, WEAK_HASH_KEY, WEAK_HASH_VALUE, DOHASH)
(DOHASH_WEAK, set_hash_key_slot, set_hash_value_slot)
(set_weak_hash_key_slot, set_weak_hash_value_slot): Adapt to
hash_table_kv.
(DOHASH [USE_EPHEMERON_POOL]): New version.
* src/igc.h (enum igc_obj_type): Add IGC_OBJ_PAIR_VECTOR,
IGC_OBJ_WEAK_KEY_PAIR_VECTOR, IGC_OBJ_WEAK_VALUE_PAIR_VECTOR,
IGC_OBJ_WEAK_OR_PAIR_VECTOR.
(igc_alloc_pair_vector): New prototype.
* src/igc.c (obj_type_names, set_header, dflt_scan_obj, thread_ap):
Handle new tpes.
(struct igc_thread, create_ephemeron_ap, create_thread_aps)
(igc_thread_remove): Add allocation point for ephemeron pool.
(struct igc, make_pool_aeph, make_igc): Add ephemeron pool.
(as_igc_header, fix_pair_vector, decode_ptr, encode_ptr)
(increment_ndeleted, splat_pair, fix_weak_key_pair, fix_weak_value_pair)
(fix_weak_or_pair, fix_weak_and_pair, scan_pair_vector)
(fix_weak_key_pair_vector, fix_weak_value_pair_vector)
(fix_weak_or_pair_vector, fix_weak_and_pair_vector): New helpers.
(fix_hash_table, fix_weak_hash_table_strong_part)
(fix_weak_hash_table_weak_part): Adapt to hash_table_kv.
(igc_alloc_pair_vector): New function.
* src/fns.c (maybe_resize_hash_table): Call maybe_resize_hash_table.
(Fgethash): Add assertion for HASH_UNUSED_ENTRY_KEY.
(Fhash_table_count): Take deleted entries into account.
(hash_table_kv_init, hash_table_kv_create)
(hash_table_kv_resize, hash_table_kv_free): New helpers.
(hash_table_kv_ndeleted, hash_table_ndeleted)
(hash_table_count, reclaim_deleted_entries)
(maybe_reclaim_deleted_entries): New helpers.
(make_hash_table, copy_hash_table, hash_table_thaw, hash_table_rehash)
(allocate_weak_hash_table_parts, make_weak_hash_table)
(maybe_resize_weak_hash_table): Adapt to hash_table_kv.
* src/alloc.c (cleanup_vector): Adapt to hash_table_kv.
* src/pdumper.c (hash_table_contents, hash_table_freeze)
(dump_hash_table): Adapt to hash_table_kv.
(dump_hash_table_kv_slot, dump_hash_table_kv, dump_hash_table_kv_part):
New helpers.
* src/print.c (print_object): Use Fhash_table_count instead
of the h->count field.
* test/src/fns-tests.el (ft--check-entries): Check hash-table-count.
(ft-weak-fixnums2, ft--test-weak-fixnums2): New test.
(ft--test-ephemeron-table): Better check for hash-table-count.
2026-02-02 22:29:19 +01:00
Helmut Eller
e8b9677acd Handle accesses to protected AMC segments while in ephemeron band
* mps/code/trace.c (TraceRankForAccess): While in the ephemeron band,
use RankFINAL for final segments and RankEXACT for the others.
* mps/test/function/eph5.c: New Test.
* mps/test/testsets/passing: Include eph5.c.
* mps/test/test/testlib/ephfmt.h (union header): Use a one-word header.
* mps/test/test/testlib/ephfmt.c: Update accordingly.
* mps/test/function/eph1.c: Update accordingly.
2026-02-02 17:27:23 +01:00
Eli Zaretskii
61b2ece41b ; * src/sound.c (Fw32_sound_volume): Avoid compiler warning. 2026-01-31 13:06:36 +02:00
Helmut Eller
0fc6ab4597 Merge branch 'master' into feature/igc 2026-01-30 09:50:17 +01:00
Juri Linkov
3584a762b8 New key 'M-j' for 'icomplete-mode' (bug#62108)
* lisp/icomplete.el (icomplete-exit): New alias for 'icomplete-fido-exit'.
(icomplete-minibuffer-map): Bind it to "M-j" .

* lisp/replace.el (multi-occur--prompt): Show "M-j" bound to 'icomplete-exit'
in 'icomplete-mode'.
2026-01-30 09:27:12 +02:00
Spencer Baugh
31944efb82 eager-display *Completions* again after completion failure
If the completion table requests eager-update (so *Completions*
should be updated as the user types, when already displayed)
then *Completions* will be dismissed automatically if the user
types something which isn't a completion.  Previously,
*Completions* wouldn't be redisplayed until the user requests it
again.  Now, if the completion table also enables eager-display
in addition to eager-update, then automatically redisplay
*Completions* after it disappears.

* lisp/minibuffer.el (completions--start-eager-display): Add
REQUIRE-EAGER-UPDATE argument and don't run if Completions is
already displayed.
(completions--after-change): Call
'completions--start-eager-display'.
(minibuffer-completion-help): Add the 'completions--after-change'
hook earlier, and let it remove itself (bug#80055).
2026-01-30 09:18:56 +02:00
Eli Zaretskii
eca025334e ; Fix last change
* etc/NEWS:
* doc/lispref/windows.texi (Choosing Window Options):
* doc/emacs/windows.texi (Window Choice): Improve documentation of
'split-window-preferred-direction'.
2026-01-29 22:13:02 +02:00
Sean Whitton
b9bfe461b2 ; Fix minibuffer-message NEWS entry. 2026-01-29 17:08:55 +00:00
Sean Whitton
88d787d97c ; * lisp/ldefs-boot.el: Regenerate. 2026-01-29 17:03:58 +00:00
Sean Whitton
12e53dfafe New C-x v T l and C-x v T L commands
* lisp/vc/vc.el (vc-log-outgoing-base)
(vc-root-log-outgoing-base): New commands.
* lisp/vc/vc-dir.el (vc-dir-mode-map):
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind them.
* doc/emacs/vc1-xtra.texi (Outstanding Changes):
* etc/NEWS: Document them.
2026-01-29 17:01:32 +00:00
Sean Whitton
60b9435ad7 ; Fix/improve two comments. 2026-01-29 17:00:46 +00:00
Spencer Baugh
0ab5db015f (minibuffer-message): Do not block while displaying message.
* lisp/minibuffer.el (minibuffer--message-overlay)
(minibuffer--message-timer): New variables.
(minibuffer--delete-message-overlay): New function.
(minibuffer-message): Use a timer and 'pre-command-hook' to
clear message overlay instead of blocking with
'sit-for'. (bug#79510)
* etc/NEWS: Document the change.
2026-01-29 16:56:38 +00:00
Dmitry Gutov
3937833fff xref-find-backend: Error instead of returning nil
* lisp/progmodes/xref.el (xref-find-backend):
Signal error when we can't find a backend to use (bug#80246).
2026-01-29 17:11:45 +02:00
Sean Whitton
38d0ac8f67 ; * lisp/window.el (window--frame-landscape-p): Improve docstring. 2026-01-29 14:38:07 +00:00
Spencer Baugh
4dc7d6056f Use frame-pixel-width/height to determine if frame is landscape
* lisp/window.el (window--frame-landscape-p): New function.
(split-window-sensibly): Call it (bug#80053).
2026-01-29 14:38:07 +00:00
Mattias Engdegård
495f6b412d tutorial.el: don't mutate quoted list
* lisp/tutorial.el (tutorial--default-keys):
Don't sort quoted list in-place.  Sort at compile time, not load time.
Uniform key representation (vectors) so that the default comparison can
be used.  Eliminate unnecessary backquote.
(tutorial--sort-keys): Remove.
2026-01-29 13:53:53 +01:00
Mattias Engdegård
c07ffa2188 * lisp/tutorial.el (tutorial--describe-nonstandard-key): add space 2026-01-29 13:53:53 +01:00
Eli Zaretskii
792097d747 Avoid interference between child frame deletion and recentering
* src/frame.c (delete_frame) [HAVE_X_WINDOWS]: Block input while
child frame is displayed, and process the X events triggered by
that later.  Patch by Byakuren (https://web.liminal.cafe/~byakuren/).
(Bug#76186)

Copyright-paperwork-exempt: yes
2026-01-29 13:38:22 +02:00
Eli Zaretskii
80551807d4 ; Fix package-vc-tests for older versions of Git
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-create-repository): Fix commands for older
versions of Git.
2026-01-29 10:29:40 +02:00
Po Lu
1bbc7d955a ; Update Android dependencies again 2026-01-29 11:25:57 +08:00
Po Lu
f949d5ab62 ; Update Android dependencies 2026-01-29 11:20:48 +08:00
Dmitry Gutov
dfc2a66ad8 xref-matches-in-directory and xref-matches-in-files: More consistency
* lisp/progmodes/xref.el (xref--parse-hits, xref--sort-hits):
Extract from xref-matches-in-directory and xref-matches-in-files.
Use in both for better consistency between these functions.
2026-01-28 23:48:04 +02:00
Dmitry Gutov
d44b855b0c xref-matches-in-directory: Don't error on "Binary file ... matches"
* lisp/progmodes/xref.el (xref-matches-in-directory):
Consider the "Binary file ... matches" message (bug#80246).
2026-01-28 22:10:34 +02:00
Stefan Monnier
fbe4d649c3 (loaddefs-generate--make-autoload): Try harder to find autoload-macro
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Try and (auto)load the macro in case that defines `autoload-macro`.
Simplify the code for the `loaddefs--defining-macros` case.
2026-01-28 13:43:36 -05:00
Przemysław Kryger
b370a076b9 Create package-vc-tests repositories once per tests run (bug#80235)
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-repos): New variable.
(package-vc-tests-create-repository): Add argument `repos-dir'.
(package-vc-tests-make-temp-dir): Create a temporary directory
with prefix.
(package-vc-with-tests-environment): Use
`package-vc-tests-make-temp-dir' to create a temporary directory
for package test.  Use `package-vc-tests-repos' to cache test
package repository.
(package-vc-tests-preserve-pkg-artifacts-p): Detect when to
preserve package temporary files.
(package-vc-tests-environment-tear-down): Use
`package-vc-tests-preserve-pkg-artifacts-p'.  Use plural there
are more than one buffer.  Report temporary directory with test
repository.
(package-vc-tests-add-ert-run-tests-listener): Wrap listener in
args with custom functionality for `package-vc-tests'.  On tests
run start reset `package-vc-tests-repos' cache.  On tests run
end delete temporary directories.
2026-01-28 18:44:06 +01:00
Sean Whitton
43d6907ad9 Move outstanding changes commands from 'o' to 'T'
The main reason for this is that then these commands can have
the same bindings in VC-Dir buffers that they have under
vc-prefix-map.  'T' is a good mnemonic for "Topic" and a
serviceable mnemonic for "outsTanding".

* lisp/vc/vc-hooks.el (vc-prefix-map): Move 'o' to 'T'.
* lisp/vc/vc-dir.el (vc-dir-mode-map): New 'T' bindings.
2026-01-28 16:13:47 +00:00
Eli Zaretskii
08b7739cf1 ; Fix MS-Windows build broken by recent treesit.c changes
* src/treesit.c (ts_tree_cursor_copy) [WINDOWSNT]: Remove, as it
is no longer used.
(ts_tree_cursor_goto_previous_sibling) [WINDOWSNT]: Add.  (Bug#80108)
2026-01-28 14:09:12 +02:00
Michael Albinus
aaa505025f Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2026-01-28 12:44:30 +01:00
Michael Albinus
8c84a2ae71 New Tramp test
* test/lisp/net/tramp-tests.el (tramp-test45-force-remote-file-error):
New test.
2026-01-28 12:43:38 +01:00
Basil L. Contovounesios
f9080e9bc0 Always unset lisp_data when freeing images
Historically only the GIF code did this (since it stores animation
metadata in lisp_data), and recently the WebP code followed suit.
The benefit of clearing lisp_data is not 100% clear (to me:
bug#66221#41), but it probably can't hurt, so do it unconditionally
for all image types to simplify conditional compilation and avoid
warnings (bug#80266).

* src/image.c (image_clear_image): Set lisp_data to nil.
[HAVE_GIF || HAVE_WEBP] (gif_clear_image):
[HAVE_IMAGEMAGICK] (imagemagick_clear_image): Remove, replacing all
uses with image_clear_image.
2026-01-28 10:29:46 +01:00
Basil L. Contovounesios
89dad01763 ; Fix last change to test/src/process-tests.el. 2026-01-28 10:29:46 +01:00
Yuan Fu
69dc5d3f0e
Fix tree-sitter traversal slowness (bug#80108)
* configure.ac (LIBSYSTEMD_CFLAGS): Increase minimal required
tree-sitter version to 0.20.10.
* src/treesit.c (treesit_traverse_sibling_helper): When
traversing forward, use the new function
ts_tree_cursor_goto_previous_sibling.
2026-01-28 01:08:52 -08:00
Daniel Mendler
32cffe1707 Customizable xref-references-in-directory backend
Optionally use find and grep directly instead of going through the
Semantic framework (bug#80246).

* lisp/progmodes/project.el (project--vc-ignores): Require 'vc' to
ensure that vc-default-ignore-completion-table is available.

* lisp/progmodes/xref.el (xref-references-in-directory-function):
New user option.
(xref-references-in-directory): Call it.
(xref-references-in-directory-grep): Implementation based on find/grep.
(xref-references-in-directory-semantic): Implementation using Semantic.
(xref-matches-in-directory): Add new argument DELIMITED.

Co-authored-by: Dmitry Gutov <dmitry@gutov.dev>
2026-01-28 04:38:58 +02:00
Michael Albinus
d09cedc9bf ; Instrument filenotify test
* test/lisp/filenotify-tests.el (file-notify-test08-backup):
Instrument test.
2026-01-27 18:49:37 +01:00
Michael Albinus
50bb4ae1eb ; * test/src/process-tests.el: Instrument for bug#80166. 2026-01-27 18:39:47 +01:00
Michael Albinus
7fa90d50c6 Organize tramp-adb-handle-make-process a little bit better
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
Call `tramp-taint-remote-process-buffer' where it belongs to.
2026-01-27 18:25:05 +01:00