* etc/NEWS: Announce the new customization option (bug#80215).
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode): New customization group.
(yaml-ts-mode-yamllint-options): New customization option.
(yaml-ts-mode--flymake-process): New variable that stores the reference
to the flymake process.
(yaml-ts-mode-flymake): New function that implements support for Flymake.
* lisp/progmodes/json-ts-mode.el (json-ts--get-path-at-node)
(json-ts--path-to-jq, json-ts--path-to-python): New functions.
(json-ts-jq-path-at-point): New command for getting JSON path at point.
* test/lisp/progmodes/json-ts-mode-tests.el: New file.
Add tests for the utility command.
* etc/NEWS: Announce new command 'json-ts-jq-path-at-point' (bug#80190).
Some language servers request file watching for a very large number of
directories (e.g. Python virtualenvs), which can exhaust system
resources and cause slow startup.
https://github.com/joaotavora/eglot/issues/1568
* lisp/progmodes/eglot.el (eglot-max-file-watches): New variable.
(eglot--count-file-watches): New function.
(eglot--watch-globs): Use them to limit watches. Signal jsonrpc-error
when limit is reached.
(eglot-watch-files-outside-project-root): Fix docstring punctuation.
* etc/EGLOT-NEWS: Mention change.
The current 2026 landscape suggests servers (especially gopls
and ocamllsp) take advantage of this, so let's give it to them
by default.
* lisp/progmodes/eglot.el (eglot-advertise-cancellation):
Default to t.
* etc/EGLOT-NEWS: Mention change.
The info returned from `garbage-collect` is really handy to
track the evolution of the heap size, but sadly it's available only
at the cost of running a full GC, which has two big downsides:
it's slow, it affects what we're measuring, and it can't be used
in `post-gc-hook`.
So, this patch makes it available without running the GC.
* src/alloc.c (Fgarbage_collect_heapsize): New function, extracted from
`Fgarbage_collect`.
(Fgarbage_collect): Use it.
(syms_of_alloc): defsubr it.
* doc/lispref/internals.texi (Garbage Collection): Extract
documentation for it from that of `garbage-collect`.
* lisp/textmodes/text-mode.el (center-line-mode--track-changes):
New local variable for storing the id of the change tracker registered
for the current buffer.
(center-line-mode--track-changes-signal): New function to be called by
the track-changes library whenever there is a change in the current
buffer.
(center-line-mode--track-changes-function): New function called from the
above signal function, iterates over the lines of the modified region,
calling 'center-line' for each non-empty line.
(center-line-mode): New minor mode.
* etc/NEWS: Document the new minor mode.
* doc/misc/dbus.texi (Top): Add "Inhibitor Locks" submenu.
Remove trailing period from chapter and section titles.
(Inhibitor Locks): New node.
* etc/NEWS: New D-Bus functions to support systemd inhibitor locks.
Presentational fixes and improvements.
* src/dbusbind.c (xd_registered_inhibitor_locks): New variable.
(Fdbus_make_inhibitor_lock, Fdbus_close_inhibitor_lock)
(Fdbus_registered_inhibitor_locks): New DEFUNs. (Bug#79963)
(syms_of_dbusbind_for_pdumper): Initialize
`xd_registered_inhibitor_locks'.
(syms_of_dbusbind): Declare subroutines
`Sdbus_make_inhibitor_lock', `Sdbus_close_inhibitor_lock' and
`Sdbus_registered_inhibitor_locks'. Declare symbol `Qdbus_call_method'.
staticpro `xd_registered_inhibitor_locks'.
* test/lisp/net/dbus-tests.el (dbus--test-systemd-service)
(dbus--test-systemd-path, dbus--test-systemd-manager-interface):
New defconsts.
(dbus-test10-inhibitor-locks): New test.
* etc/NEWS:
* doc/emacs/maintaining.texi (Projects):
* lisp/progmodes/project.el (project-mode-line): Update
documentation due to changes in bug#78545.
Add an optional 'context' argument to 'make-progress-reporter'
which 'progress-reporter-echo-area' consults to inhibit updates
if the context is 'async' and the echo area is busy.
* lisp/subr.el (make-progress-reporter): Add the optional
'context' argument.
(progress-reporter-context): New defun accessor.
(progress-reporter-echo-area): Consult
'progress-reporter-context'.
* doc/lispref/display.texi: Document context.
* etc/NEWS: Announce context.
* lisp/textmodes/ispell.el (ispell-save-corrections-as-abbrevs):
New user option.
(ispell--abbrev-saving-allowed)
(ispell--save-correction-as-abbrev): New variables.
(ispell--maybe-save-correction-abbrev): New function.
(ispell-word, ispell-process-line): Use them to save corrections
as abbrevs when appropriate (bug#79985).
(ispell-command-loop): Add C-u as command character to toggle
abbrev saving for an immediately following replacement command.
(ispell-help): Document C-u binding.
* doc/emacs/fixit.texi (Spelling): Document new feature.
A unique frame id is assigned to a new or cloned frame, and
reused on an undeleted frame.
The id facilitates unambiguous identification among frames that
share identical names or titles, deleted frames where a live
frame object no longer exists that we can resurrect by id, for
example via 'tab-bar-undo-close-tab'. It also aids debugging at
the C level using the frame struct member id.
Rewrite 'clone-frame' and 'undelete-frame' to not let bind
variables that 'make-frame' uses to avoid conflicts with nested
'make-frame' calls, for example via
'after-make-frame-functions'.
* lisp/frame.el (clone-frame, undelete-frame): Use
'frame--purify-parameters' to supply parameters explicitly.
(undelete-frame--save-deleted-frame): Save frame id for
restoration.
(undelete-frame): Restore frame id.
(frame--purify-parameters): New defun.
(make-frame): Assign a new id for a new or cloned frame, reuse
for undeleted frame.
* src/frame.h (struct frame): Add id member.
(frame_next_id): New extern.
* src/frame.c (frame_next_id): New global counter.
(frame_set_id, frame_set_id_from_params): New function.
(Fframe_id): New DEFUN.
(syms_of_frame <Sframe_id>): New defsubr.
(syms_of_frame <Qinternal_id>): New DEFSYM.
(syms_of_frame <frame_internal_parameters>): Add 'Qinternal_id'.
* src/androidfns.c (Fx_create_frame):
* src/haikufns.c (Fx_create_frame):
* src/nsfns.m (Fx_create_frame):
* src/pgtkfns.c (Fx_create_frame):
* src/w32fns.c (Fx_create_frame):
* src/xfns.c (Fx_create_frame): Call 'frame_set_id_from_params'.
* doc/lispref/frames.texi: Add documentation.
* etc/NEWS: Announce frame id.
In a large (or simply long) file with many diagnostics, calling
eglot-range-region repeteadly constantly throws Emacs for a spin
around the buffer, since each diagnostics comes annotated with a
(line/col): LSP range spec that is reasonably expensive to
translate into Elisp point positions.
A much faster approach for such large lists is to first sort all the
objects containing ranges by their start lines and then do a
single pass of the buffer, moving lines by delta.
By much faster, I do mean spectacularly (100x) faster. A long python
with 7000 "ruff" diagnostics, before the change, typical editor
operations (add/delete words) are impossible.
14053 84% - jsonrpc-connection-receive
14052 84% - #<byte-code-function B94>
14052 84% - apply
14052 84% - eglot-handle-notification
14052 84% - applyn
14052 84% - #<byte-code-function 6DB>
14052 84% - eglot--flymake-handle-push
12295 74% - eglot--flymake-make-diag
12218 73% + eglot-range-region
50 0% + eglot--check-object
12 0% plist-member
3 0% flymake-make-diagnostic
After the change:
99 1% - jsonrpc-connection-receive
99 1% - #<byte-code-function 0EE>
99 1% - apply
99 1% - eglot-handle-notification
99 1% - apply
99 1% - #<byte-code-function E84>
99 1% - eglot--flymake-handle-push
99 1% - eglot--call-with-ranged
99 1% - #<byte-code-function 2C6>
99 1% - eglot-move-to-utf-16-linepos
99 1% line-end-position
* lisp/progmodes/eglot.el (eglot-move-to-linepos-function):
Forward declare.
(eglot--call-with-ranged, eglot--collecting-ranged): New helpers.
(eglot--flymake-report-1)
(eglot--imenu-SymbolInformation): Use eglot--collecting-ranged.
(eglot--imenu-DocumentSymbol): Could use eglot--collecting-ranged.
* etc/EGLOT-NEWS: Mention it
This documents how to use LSP multiplexer programs like Rassumfrassum
to connect multiple language servers to a single buffer.
* doc/misc/eglot.texi (Top): Add "Multi-server support" menu entry.
(Multi-server support): New chapter.
(Using Rassumfrassum, Design rationale): New sections documenting
how to use the Rassumfrassum multiplexer program with Eglot, with
practical examples for C++, Python, and multi-language files.
(Performance): Mention Rassumfrassum as solution for JSONRPC traffic
performance issues.
(Reporting bugs): Add guidance for troubleshooting multiplexer-related
bugs. Improve project description guidance. Fix various typos.
* lisp/progmodes/eglot.el (eglot-server-programs): Add a couple
of rass entries.
* etc/EGLOT-NEWS: Announce support for LSP server multiplexers via
Rassumfrassum.
* lisp/term/xterm.el (xterm-update-cursor): New user option.
(xterm--init): Use it.
(xterm--post-command-hook): New function for all xterm
functionality installed in 'post-command-hook'.
(xterm--init-frame-title): Install it.
(xterm--init-update-cursor, xterm--set-cursor-type)
(xterm--update-cursor-type, xterm--update-cursor-color): New
functions.
(xterm--cursor-type-to-int): New constant.
* doc/emacs/display.texi (Cursor Display):
* etc/NEWS: Document the new feature.
* lisp/emacs-lisp/package.el (package-isolate): Fetch missing
packages and make them available in the new Emacs process, but
not the current one.
* etc/NEWS: Mention change.
* lisp/emacs-lisp/package.el (package-review-policy)
(package-review-directory, package-review-diff-command): Add
new options.
(package--review-p): Add new function to consult
'package-review-policy'.
(package-review): Add new function.
(package-unpack): Use new functions.
(package-install-from-archive): Return package descriptors of
installed packages.
(package-download-transaction): Handle failure of a incomplete
transaction.
(package-install): Report if a package installation failed.
(package-upgrade): Anticipate a failed package transaction by
not deleting a package beforehand.
(package-install-from-buffer): Handle the failure to download
dependencies or a rejection during the actual package review.
* doc/emacs/package.texi: Document feature.
* etc/NEWS: Mention new feature.
The only alternative I've found is
M-: ( i n f o " ( e g l o t ) " ) RET
which isn't really very user friendly.
* lisp/progmodes/eglot.el (eglot-manual): Unobsolete.
* doc/misc/eglot.texi (Top): Mention M-x eglot-manual.
* etc/EGLOT-NEWS: Mention unobsoletion.
* doc/misc/tramp.texi (External methods): Mention, how external
methods are used for multi-hops.
(Ad-hoc multi-hops): Change requirement of method.
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.8.2-pre".
* etc/NEWS: External Tramp methods can be used in multi-hops.
Presentational fixes and improvements.
* lisp/net/tramp-sh.el (tramp-sh-handle-copy-directory): Check for
`tramp-method-out-of-band-p' explicitly. Don't flush directory
properties.
(tramp-method-out-of-band-p): There shouldn't be a multi-hop.
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory): Don't
flush directory properties.
* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-barf-if-file-missing)
(with-parsed-tramp-file-name): Adapt debug spec.
(tramp-skeleton-copy-directory): Flush directory properties.
(tramp-add-hops): Check for `tramp-login-args' property.
* src/window.c (Fwindow_cursor_info): New function.
(syms_of_window): Defsubr it.
* doc/lispref/windows.texi (Window Point): Document it.
* etc/NEWS: Announce new function. (Bug#80023)
* lisp/frame.el (clone-frame): Set the frame parameter
'cloned-from'.
(undelete-frame): Set the frame parameter 'undeleted'.
* src/frame.c (syms_of_frame): <Qcloned_from> <Qundeleted>: New
DEFSYM.
(syms_of_frame): Add 'Qcloned_from' and 'Qundeleted' to
'frame_internal_parameters'.
* doc/lispref/frames.texi: Document these frame parameters.
* etc/NEWS: Announce the new frame parameters.
The direct cause of the problem in the bug report is that when
user runs treesit-font-lock-recompute-features to add the
emacs-devel feature in c-ts-mode's mode hook, the added query
for emacs-devel aren't compiled.
This change consists of two parts:
1. The immediate fix: validate and compile queries in
treesit-font-lock-recompute-features.
2. To make it more fool-proof, change treesit-font-lock-rules
back to compile the queries and make
treesit--compile-query-with-cache support compiled queries. This
way, as long as the query goes through treesit-font-lock-rules,
it'll be compiled eventually and not cause slow-down. I had to
add some c-level functions, but they're kind of overdue anyway,
so I don't have any problem adding them to the API.
* lisp/treesit.el (treesit--compile-query-with-cache): Support
compiled queries.
(treesit-font-lock-rules): Compile the queries (but not
eagerly).
(treesit-font-lock-recompute-features): Validate and compile
queries.
(treesit-major-mode-setup): Remove call to
treesit-validate-and-compile-font-lock-rules since it's now
called in treesit-font-lock-recompute-features.
* src/treesit.c (Ftreesit_query_eagerly_compiled_p):
(Ftreesit_query_source): New functions.
* doc/lispref/parsing.texi (Pattern Matching): Add manual
entries for the new functions.