Commit graph

190982 commits

Author SHA1 Message Date
Helmut Eller
2a5adbb807 Allow the GC to collect markers in the undo-list
* src/undo.c (struct weak_marker_table): New struct.
(weak_marker_table): New variable.
(alloc_weak_marker_id, scrub_undo_lists, scrub_undo_list): New
functions.
(record_marker_adjustments)[MPS]: Instead of (MARKER . DISTANCE)
entries, create entries of the form (apply undo--adjust-weak-marker HTAB
ID DISTANCE).  This avoids direct references to markers and hence allows
the GC to collect markers.
(Qundo__adjust_weak_marker): New symbol.
(syms_of_undo): Initialize Qundo__adjust_weak_marker and
weak_marker_table.
* src/lisp.h (scrub_undo_lists): New prototype.
* src/igc.c (process_one_message): Call scrub_undo_lists when a
collection cycle has ended.
* lisp/simple.el (primitive-undo): Handle the new entries.
* test/src/editfns-tests.el (delete-region-undo-markers-1,
delete-region-undo-markers-2): Adjust for new entries.
* test/lisp/erc/erc-tests.el (erc-update-undo-list): Adjust for new
entries.
2026-06-10 11:04:38 +02:00
Óscar Fuentes
18548c4b25 ; src/json.c: update value of parser->object_workspace_size
It was removed in a merge commit (50c6d07035) and was causing a large
memory leak.
2026-06-09 19:59:03 +02:00
Helmut Eller
d150f9800d Add a comment to fns-tests-weak-equal-table
* test/src/fns-tests.el (ft--gc): Execute finalizers only when
requested.
2026-06-08 17:48:38 +02:00
Pip Cet
5f9b9dda08 Improve marker hygiene in unwind_format_mode_line (bug#79200)
* src/xdisp.c (unwind_format_mode_line): Unchain markers after we're
done with them.
2026-06-07 18:36:50 +00:00
Pip Cet
4d352d8f05 [MPS] Fix assertion error "finalization not implemented"
* src/igc.c (finalize_vector): Remove assertion.  Reaching this code
is legitimate if exthdrs are involved.
2026-06-07 16:42:04 +00:00
Pip Cet
715f22d3ba [MPS] Make weak hash tables even weaker
Previously, a weak-key hash table would consider its values reachable
until the key became unreachable; this loses in cases like

    (puthash x x weak-hash-table)

where the desired behavior is to remove the entry as soon as 'x' can
no longer be reached from other data.

This change switches to a more complicated implementation that uses
extra dependencies (a kind of hidden plist associated with each
object) to record whether another object needs to be kept alive by
this object because it is, for example, a key in a weak-key hash table
which needs to keep its value alive.

Unfortunately, the old behavior is still required to implement the new
behavior correctly.

* src/fns.c (keep_entry_p): Adjust for the unlikely case that the new
weakness value makes it here.
(allocate_weak_hash_table_parts): Adjust by making both keys and
values weak in the usual case.
(weak_hash_put): Declare "static".
(hash_table_weakness_symbol): Adjust for the unlikely case that
Weak_Key_Strong_Value makes it here.
(Fputhash): Adjust for weak hash tables.
* src/igc.c (fix_weak_hash_table_strong_part):
(fix_weak_hash_table_weak_part):
(igc_make_weak_hash_table_strong_part):
(igc_make_weak_hash_table_weak_part): Adjust allocation and scanning
methods.
(igc_dump_finish_obj): Avoid putting an extended header into the dump.
(Figc__add_extra_dependency): Create internal hash table as
Weak_Key_Strong_Value.
(syms_of_igc): Make Vigc__dependency_replacements a
Weak_Key_Strong_Value table.
* test/src/fns-tests.el (ft--gc): Always run two GC cycles.
(ft-ephemeron-table):
(ft-weak-equal-table): Mark as expected successes.
2026-06-06 17:12:25 +00:00
Pip Cet
7df2ce631b Add new hashtable weakness
Currently for MPS-internal use only, this weakness value indicates
that the keys are held weakly but values are held strongly even if
they only correspond to otherwise unreachable keys.  This means that
using the same object as key and value in these hash tables will keep
the object alive indefinitely.

* src/lisp.h (hash_table_weakness_t): Add Weak_Key_Strong_Value.
(struct Lisp_Hash_Table): Expand weakness bitfield.
2026-06-06 16:44:16 +00:00
Pip Cet
ee87a825c7 [MPS] Atomically update extended headers
* src/igc.c (igc_external_header): Return copy of header.
(igc_update_exthdr): New.
(Figc__extra_dependency):
(Figc__add_extra_dependency):
(Figc__remove_extra_dependency): Adjust.
2026-06-06 14:36:20 +00:00
Pip Cet
d3ed9ea699 Implement Fmarkers_in using a marker_it
* src/marker.c (Fmarkers_in): Use 'marker_it_init' and friends.
2026-06-06 14:35:22 +00:00
Pip Cet
540dbab6b1 Merge branch 'savannah/master' into feature/igc3 2026-06-06 14:34:54 +00:00
Eli Zaretskii
4d8fb1623c Merge from origin/emacs-31
a24b081602 ; Fix last change
e33e9f7e85 Document 'margin' face as base for margin display strings...
cff9c8bc00 Improve prompting for mail sending by by 'report-emacs-bug'

# Conflicts:
#	etc/NEWS
2026-06-06 06:19:09 -04:00
Eli Zaretskii
a24b081602 ; Fix last change
* etc/NEWS:
* doc/lispref/frames.texi (Font and Color Parameters):
* doc/lispref/display.texi (Displaying Faces, Basic Faces):
Improve indexing of faces and wording of the description of the
'margin' face and its implications.
2026-06-06 12:06:42 +03:00
Andrea Alberti
e33e9f7e85 Document 'margin' face as base for margin display strings (Bug#80693)
* doc/lispref/display.texi (Displaying Faces): Note that the
underlying-text rule does not apply to strings displayed in the
display margins, and reword the margin-face bullet to describe
'margin' as the base.
(Basic Faces): Note that the 'margin' face also provides the base
attributes for strings displayed in the margins.
(Display Margins): Drop a sentence that restated the preceding one
about unspecified attributes inheriting from 'margin'.
* etc/NEWS: Document the change for margin strings.

Suggested by F. Jason Park <jp@neverwas.me>.
2026-06-06 11:45:52 +03:00
Augusto Stoffel
cff9c8bc00 Improve prompting for mail sending by by 'report-emacs-bug'
* lisp/mail/emacsbug.el (report-emacs-bug-hook): Don't ask about
mail sending options if 'message-server-alist' is set.  (Bug#81176)
2026-06-06 11:40:53 +03:00
Po Lu
7ffbf45886 Merge from savannah/emacs-31
916572f6e0 Fix the Android build
3801c09ae2 Don't resurrect invisible child frames when rebuilding pa...
e4350c538f Improve progress-reporter state to remove hard coded leng...
30df8657fb (tex-main-file): Add forgotten safety predicate (bug#81099)
35a82765bf Fix bug in latexenc when AUCTeX is loaded
e9d1367a32 paren.el: Fix part of bug#81035
fd1b5cd890 ; * test/lisp/files-tests.el (w32-downcase-file-names): D...
79391d3e19 ; * lisp/mouse.el (send-to--resolve-handler): Fix last ch...
eb1de3f585 ; Avoid rebuilding Emacs Lisp Intro when building release...
f26f2a832c ; Avoid byte-compilation warning in mouse.el
cf325876fa Adapt Tramp version
84556123eb ; * admin/make-tarball.txt: Update.
8f5b786cac Check buffer-local value in tramp-local-environment-varia...
2026-06-06 11:39:01 +08:00
Po Lu
a21e93b7e2 ; * doc/lispref/compile.texi (Speed of Byte-Code): Fix typo. 2026-06-06 11:38:49 +08:00
Po Lu
916572f6e0 Fix the Android build
* configure.ac: Don't test for libgccjit.h if a preceding test
have already concluded that native compilation is unavailable.
2026-06-06 11:38:04 +08:00
Paul Eggert
2f69971714 mpc-last-seek-time and mpc--faster are no longer used
* lisp/mpc.el (mpc-last-seek-time, mpc--faster):
Add a FIXME; should they be removed?
2026-06-05 19:16:29 -07:00
Paul Eggert
4fd59d0eba Omit a ‘/’ from org-clock-resolve
* lisp/org/org-clock.el (org-clock-resolve): Replace (floor (/ X
60)) with (floor X 60).
2026-06-05 19:16:29 -07:00
Paul Eggert
5eee9e239b Simplify gnus-backend-trace time calc
* lisp/gnus/gnus-int.el (gnus-backend-trace):
Simplify, since (float-time (time-since nil)) returns 0.0.
2026-06-05 19:16:29 -07:00
Paul Eggert
56b93016fc Simplify epa-ks--display-keys time calc
* lisp/epa-ks.el (epa-ks--display-keys):
Simplify by using time-less-p.  This also avoids a rounding error.
2026-06-05 19:16:29 -07:00
Paul Eggert
2dc98b69e0 format-seconds takes time values, not just numbers
* lisp/calendar/time-date.el (format-seconds): Document that the arg
can be any time value, and need not be a number.
This has been true for some time, but has not been documented.
Avoid some (but not all) rounding errors internally, and add a
comment about the remaining rounding error.
* lisp/emacs-lisp/timer-list.el (list-timers):
* lisp/org/org-timer.el (org-timer-show-remaining-time):
* lisp/org/ox.el (org-export--stack-generate):
* lisp/time.el (emacs-uptime): Omit unnecessary conversion of time
value that can increase rounding error.
* test/lisp/calendar/time-date-tests.el (test-format-seconds):
Test that format-seconds works on time values that are not numbers.
2026-06-05 19:16:29 -07:00
Paul Eggert
1b019b135b Avoid double-rounding in byte-code speed doc
* doc/lispref/compile.texi (Speed of Byte-Code):
Avoid some double-rounding in time calculations.
Modernize the timings.
2026-06-05 19:16:29 -07:00
Andrea Alberti
bf9a1e1f16 Fix respondsToSelector: selector for native fullscreen check
The two -respondsToSelector: guards in -[EmacsWindow
setParentChildRelationships] tested @selector(toggleFullScreen) without
the trailing colon, but the method is -toggleFullScreen:.  The colon-less
selector matches nothing, so the guarded code was always skipped.  This
is inert on modern builds (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070, where
the check is #if'd out), but on a binary targeting pre-10.7 yet running
on 10.7+ it would wrongly skip taking a child frame out of native
fullscreen.

* src/nsterm.m ([EmacsWindow setParentChildRelationships]): Add the
missing colon to both @selector(toggleFullScreen:) checks.
2026-06-05 19:29:58 +01:00
Andrea Alberti
3801c09ae2 Don't resurrect invisible child frames when rebuilding parent links
On the NS port, -[EmacsWindow setParentChildRelationships] reattaches
every child frame to its parent via -addChildWindow:ordered:, which also
orders the child window onto the screen.  This runs whenever the
parent/child relationships are rebuilt, e.g., when entering non-native
fullscreen, which allocates a fresh EmacsWindow whose initializer
rebuilds the relationships.  A child frame that Emacs had made invisible
(e.g. a corfu/company completion popup) was thereby brought back as a
stale, non-responsive child frame.  Emacs never repaints to clear it
because frame_redisplay_p trusts FRAME_VISIBLE_P on the NS port and
avoids dealing with the child frame when it is marked as invisible.

Native fullscreen does not trigger this: -toggleFullScreen: hands off to
AppKit without allocating a new window, so the rebuild never runs.

A hidden child frame is normally detached from its parent already: Emacs
hides it with -orderOut: (ns_make_frame_invisible), which per Apple's
documentation removes a child window from its parent before ordering it
out.  The fix is therefore not to re-attach a child while it is
invisible; ns_make_frame_visible already reinstates the parent/child link
when the frame is shown again.

* src/nsterm.m ([EmacsWindow setParentChildRelationships]): Only
re-attach a child window when the frame is marked visible.
(ns_make_frame_visible): Explain, with a reference to Apple's
documentation, why the parent/child link must be reinstated on show.
2026-06-05 19:22:29 +01:00
Stefan Monnier
66e02b3123 (Fmarkers_in): New function (bug#81153)
* src/marker.c (Fmarkers_in): New function.
(syms_of_marker): Defsubr it.
* doc/lispref/text.texi (Replacing): Add markers-in.
* test/src/marker-tests.el (marker-markers-in): New test.
2026-06-05 14:04:22 -04:00
Stéphane Marks
e4350c538f Improve progress-reporter state to remove hard coded length (bug#80988)
Remove hard-coded state range, now a monotonically increasing
integer.

* lisp/subr.el (progress-reporter-update-functions): Update
docstring.
(progress-reporter-echo-area): Use
'progress-reporter--pulse-characters' length.
(progress-reporter-do-update): Increase 'state' by 1 each pass.
*
lisp/system-taskbar.el (system-taskbar--progress-reporter-update):
Make steps independent of 'progress-reporter-echo-area' steps.
2026-06-05 12:55:08 -04:00
Arash Esbati
30df8657fb (tex-main-file): Add forgotten safety predicate (bug#81099)
That variable is commonly set file-locally.

* lisp/textmodes/tex-mode.el (tex-main-file): Add safety predicate.
2026-06-05 12:52:00 -04:00
Al Haji-Ali
35a82765bf Fix bug in latexenc when AUCTeX is loaded
* lisp/international/latexenc.el
(latexenc-find-file-coding-system): Set file name correctly when
`TeX-master' is a string.  (Bug#81099)
2026-06-05 12:44:25 -04:00
Stefan Monnier
e9d1367a32 paren.el: Fix part of bug#81035
* lisp/paren.el (show-paren--default): Syntax-propertize before narrowing.
2026-06-05 12:43:43 -04:00
Sean Whitton
fd1b5cd890 ; * test/lisp/files-tests.el (w32-downcase-file-names): Declare. 2026-06-05 13:07:24 +01:00
Eli Zaretskii
79391d3e19 ; * lisp/mouse.el (send-to--resolve-handler): Fix last change. 2026-06-05 15:05:19 +03:00
Eli Zaretskii
eb1de3f585 ; Avoid rebuilding Emacs Lisp Intro when building release tarball
* make-dist (info_files): Include "*.png" images, which are used
in the doc/lispintro/ directory, and should be in the tarball.
This makes sure eintr.info will not need to be rebuilt on the
end-users' systems when a release tarball is being built, due to
the fact that PNG files are copied from doc/lispintro/ and are
thus newer than eintr.info that came with the tarball.  We don't
want to force rebuilding Info files when a release tarball is
built because users are not required to have Texinfo installed.
2026-06-05 14:42:58 +03:00
Eli Zaretskii
f26f2a832c ; Avoid byte-compilation warning in mouse.el
* lisp/mouse.el (send-to): Require, not only when compiling, as
'send-to--resolve-handler' is used at run time.
2026-06-05 14:35:34 +03:00
Michael Albinus
cf325876fa Adapt Tramp version
* lisp/net/trampver.el (customize-package-emacs-version-alist):
Add Tramp version integrated in Emacs 31.1.

* doc/misc/trampver.texi:
* lisp/net/trampver.el (tramp-version): Adapt Tramp versions.
2026-06-05 13:21:15 +02:00
Sean Whitton
84556123eb ; * admin/make-tarball.txt: Update. 2026-06-05 12:18:36 +01:00
Augusto Stoffel
8f5b786cac Check buffer-local value in tramp-local-environment-variable-p
* lisp/net/tramp.el (tramp-local-environment-variable-p): Do it.
2026-06-05 12:40:08 +02:00
Sean Whitton
921273999a ; Merge from origin/emacs-31
The following commits were skipped:

0ee48ac4df ; Update ldefs-boot.el.
4f4af26dd2 Bump Emacs version to 31.0.90
2026-06-05 11:19:07 +01:00
Sean Whitton
5e160e2784 Merge from origin/emacs-31
b8133a416d ; Update exported ChangeLog files and etc/AUTHORS
5e3e1a5bb2 ; Tweak some package short descriptions.
bbe805e4b1 message.el: Fix part of bug#81035
621239ae6a Fix prompt in remote shell
6df1d33b6c Fmake_xwidget: Use about:blank workaround only when needed
f3b17c4969 Allow brew/macports libgccjit for default native compilation
7226082f46 vc-dir-refresh: Respect non-essential wrt saving buffers
438af2764d ; * doc/lispref/text.texi (Mode-Specific Indent): Fix mar...
6b39919408 ; Fix typo in prog-indentation-context documentation (bug...
95ac082d5b Merge branch 'emacs-31' of git.savannah.gnu.org:/srv/git/...
3d9d9be3a1 CC Mode: Fontify a cast type preceding a brace initializa...
fe1c02d849 Fix Tramp distrobox integration
108710992d ; * doc/misc/ert.texi (erts files): Improve example (bug#...
0989625d36 markdown-ts-mode: fix first-item indent (bug#81118)
07e02917ee [GTK3] Re-fix the stored values for width and height
776ee085ff Eglot: mentions markdown-ts-view-mode less (bug#81150)
2d915236dc vc--subject-to-file-name: Fix over-greedy regex (bug#81017)
05f89d711d Fix more missing faces on ERC margin strings
3229d6f0e3 Eglot: Simplify markdown rendering support (bug#81150)
8855e88d74 ; Improve doc strings of brows-url commands
933d35ef10 ; * lisp/net/browse-url.el (browse-url-firefox-program): ...
2026-06-05 11:19:07 +01:00
Sean Whitton
e21d3af2f9 ; Merge from origin/emacs-31
The following commit was skipped:

f357a549ac Prevent segfaults due to frame resizing at the wrong time
2026-06-05 11:19:07 +01:00
Sean Whitton
0ee48ac4df ; Update ldefs-boot.el. 2026-06-05 10:57:06 +01:00
Sean Whitton
4f4af26dd2 Bump Emacs version to 31.0.90
* README:
* configure.ac:
* exec/configure.ac:
* java/AndroidManifest.xml.in (Version-code):
* msdos/sed2v2.inp:
* nt/README.W32: Bump Emacs version to 31.0.90.
2026-06-05 10:42:43 +01:00
Sean Whitton
b8133a416d ; Update exported ChangeLog files and etc/AUTHORS
* ChangeLog.5: Update.
* etc/AUTHORS: Regenerate.
2026-06-05 10:41:22 +01:00
Sean Whitton
5e3e1a5bb2 ; Tweak some package short descriptions. 2026-06-05 10:17:27 +01:00
Pip Cet
c1eb458d6b Avoid relying on FOR_EACH_TAIL internals in 'Fnthcdr' (bug#81115)
The new FOR_EACH_TAIL code detects simple cycles sooner than the old
code did, leading to integer overflows.

* src/fns.c (Fnthcdr): Avoid integer overflow if cycle is detected
early.
2026-06-04 20:45:34 +00:00
Pip Cet
0bef3c0e87 Improve FOR_EACH_TAIL (bug#81115)
* src/lisp.h (struct for_each_tail_internal): Reduce to two words.
(FOR_EACH_TAIL_BASIC): Add compiler hint to indicate that tail is most
likely Qnil after the loop and a non-nil non-cons is unlikely.
(FOR_EACH_TAIL_STEP_CYCLEP): Rewrite.
2026-06-04 20:45:34 +00:00
Pip Cet
de67c677fe * src/lisp.h (EQ): Use new 'likely' macro. 2026-06-04 20:45:34 +00:00
Pip Cet
0f6c382888 Make 'likely' macro available in all of Emacs (bug#81115)
* src/android.c (likely): Move ...
* src/conf_post.h (likely): ... here.  Ensure true values which aren't
equal to 1 are still predicted correctly.
2026-06-04 20:45:34 +00:00
Stefan Monnier
bbe805e4b1 message.el: Fix part of bug#81035
* lisp/gnus/message.el (message-narrow-to-field)
(message-hide-headers): Syntax-propertize before narrowing.
2026-06-04 14:20:06 -04:00
Michael Albinus
621239ae6a Fix prompt in remote shell
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Do not use a
hard-coded directory in PS1.  (Bug#81177)
2026-06-04 19:44:07 +02:00