* 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.
(project-name-cache-timeout): New variable.
(project-name-cached): New function (bug#78545).
(project-mode-line): New value 'non-remote'.
(project-mode-line-format): Don't show the remote project's name
when 'project-mode-line' is 'non-remote'. Use 'project-name-cached'.
* lisp/term/xterm.el (xterm-update-cursor): Mention OSC 112 in
doc string.
(xterm--reset-cursor-color-escape-sequence): New constant.
(xterm--init-update-cursor, xterm--update-cursor-color): Use it
(bug#80091).
* doc/misc/dbus.texi (Signals): All registered signal handlers are
called.
(Synchronous Methods, Signals, Monitoring Messages): Add function
result in examples.
* src/dbusbind.c (xd_store_event): New function.
(xd_read_message_1): Use it. Call all registered handlers per
signal. (Bug#80168)
* test/lisp/net/dbus-tests.el (dbus--test-signal-handler): Adapt defun.
(dbus--test-signal-handler1, dbus--test-signal-handler2): New defuns.
(dbus-test05-register-signal-several-handlers): New test.
(dbus-test04-register-method)
(dbus-test04-call-method-authorizable)
(dbus-test05-register-signal)
(dbus-test05-register-signal-with-nils)
(dbus-test06-register-property-emits-signal): Adapt tests.
When a completion candidate has no suffix, then there is no need to
add whitespace "between" the candidate and suffix, since there is no
need to align suffixes if there are none. In this case the trailing
whitespace only serves to needlessly make all candidates the same
length, with the result that if one candidate does not fit one a
single line, then all other candidates are made to not fit either.
* lisp/emacs-lisp/package-activate.el: Move defvar of
`Info-directory-list` to when we know it should exist.
* lisp/emacs-lisp/package.el (Info-directory-list): Defvar before we
`let-bind it.
Now when calling 'Buffer-menu-unmark-all-buffers', only the
selected mark is removed.
* lisp/buff-menu.el (Buffer-menu--unmark): Add a mark parameter
to correctly select it in the entry.
(Buffer-menu-unmark, Buffer-menu-unmark-all-buffers)
(Buffer-menu-backup-unmark): Usage.
They're always called immediately before a `<` char, in which case
they do the same anyway. This saves us from having to touch
`forward-list-function` in addition to `forward-exp-function`.
While at it, change `sgml-tags-invisible` to use `define-minor-mode`.
* lisp/textmodes/sgml-mode.el (sgml-delete-tag)
(sgml-electric-tag-pair-before-change-function): Prefer `forward-sexp`
over `forward-list`.
(sgml-tags-invisible): Define with `define-minor-mode`. Don't disable
`cursor-sensor-mode` when we don't need it any more, since some other
package may be using it. Remove redundant binding of `inhibit-read-only`.
* lisp/emacs-lisp/lisp.el (forward-sexp-function): Give it a default value.
(forward-sexp): Simplify a bit.
(up-list-default-function): Fix for `forward-sexp-default-function`.
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.
(html-ts-mode--show-paren-data): New function to exclude
unbalanced tags when the closing tag is missing.
(html-ts-mode): Set 'show-paren-data-function' to
'html-ts-mode--show-paren-data' (bug#80151).
(sgml-electric-tag-pair-before-change-function):
Let-bind 'forward-list-function' to nil.
(sgml-delete-tag): Let-bind 'forward-sexp-function'
and 'forward-list-function' to nil.
(sgml-tags-invisible): Let-bind 'forward-list-function' to nil.
All this is required to use the default definitions of sexp/list
that significantly differ from treesit definitions (bug#80151).
* lisp/emacs-lisp/cl-generic.el (cl--generic-make-function):
Preserve advertised-calling-convention info.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization):
Require `byte-opt` to fix the test when the compiler is not loaded yet.
* lisp/progmodes/elisp-mode.el: Fix some >80column problems.
(elisp--xref-format-extra)
(elisp--xref-format): Make them constant, now that we don't have
the purespace. Also, use %S since some of the elements
don't necessarily have names and even if they do, we'd want to
escape any funny characters in them to avoid ambiguities.
(elisp--xref-find-definitions): Fix uses of
`elisp--xref-format-extra` accordingly.
Improve heuristic to distinguish proper `cl-defgeneric` from
implicit ones.
(elisp-eldoc-docstring-length-limit)
(elisp-eldoc-funcall-with-docstring-length): Remove redundant `:group`.
* lisp/cedet/mode-local.el (xref-mode-local-overload): Pass the
override symbol rather than its name through `elisp--xref-format-extra`.
* test/lisp/progmodes/elisp-mode-tests.el (find-defs-constructor):
Adjust test to new text.
* lisp/faces.el (tab-bar, tab-line): Adapt to dark background.
Suggested by Philip Kaludercic <philipk@posteo.net>.
* lisp/tab-bar.el (tab-bar-tab, tab-bar-tab-inactive, tab-bar-tab-highlight):
* lisp/tab-line.el (tab-line-tab, tab-line-tab-inactive)
(tab-line-tab-current, tab-line-highlight): Adapt faces to dark background.
* lisp/progmodes/gdb-mi.el (gdb-start-wait-for-pending): New
function.
(gdb-thread-exited): Call 'gdb-start-wait-for-pending' to make
sure the timer which waits for pending GDB commands is launched
just once, even if many =thread-exited notifications are received
at a high rate. Suggested by Neil Roberts <bpeeluk@yahoo.co.uk>.
(Bug#80157)
* lisp/progmodes/eglot.el (eglot--semtok-request)
(eglot--semtok-after-send-changes): Unbreak for 26.3.
* test/lisp/progmodes/eglot-tests.el (eglot--tests-connect): Use
split-string.
(eglot-test-rust-completion-exit-function): Use skip-unless.
* lisp/ibuffer.el (ibuffer-hidden-buffer-p): New function.
(ibuffer-maybe-show-predicates): Use it.
(ibuffer-fontification-alist): Use it (for consistency).
This prevents byte-compiled code appearing in the *Help* buffer
and in the customize UI for `ibuffer-maybe-show-predicates'.
* test/lisp/progmodes/eglot-tests.el
(eglot--wait-for): Fix thinkos and improve.
(eglot--tests-connect): Take TIMEOUT and SERVER kwargs.
(eglot-test-eclipse-connect)
(eglot-test-slow-sync-connection-wait)
(eglot-test-slow-sync-connection-intime): Update
eglot--tests-connect call.
Not only is this notification strictly redundant for files
managed by Eglot (since didSave, didClose and didChange are
scrupulously sent), but it also confuses some serers which end
up posting a bunch of useless textDocument/publishDiagnostics,
for example.
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
LSP Diagnostics are converted to Flymake diagnostics just-in-time.
Introduce helpers that allow precise control over the type of the
reports (clearing or incremental) and the inhibition of reports.
* lisp/progmodes/eglot.el
(eglot--pulled-diagnostics)
(eglot--pushed-diagnostics): Rework docstring.
(eglot--flymake-sniff-diagnostics): Rename from
eglot--flymake-diagnostics.
(eglot--diagnostics-map, cl-loop, eglot-warning)
(eglot-note, eglot-error): Move to Flymake section.
(eglot--find-buffer-visiting): New helper..
(eglot--flymake-handle-push): New helper.
(eglot--flymake-report-1, eglot--flymake-report-2)
(eglot--flymake-report-push+pulled): New helpers.
(eglot--flymake-make-diag): Take REGION arg.
(eglot--handle-notification<textDocument/PublishDiagnostics>):
Use eglot--flymake-handle-push.
(eglot--flymake-pull): Call eglot--flymake-report-push+pulled.
(eglot--flymake-report): Delete.
(eglot--flymake-reset): New helper.
(eglot--managed-mode): Use eglot--flymake-reset.
(eglot--diag-to-lsp-diag): Delete.
(eglot--signal-textDocument/didOpen)
(eglot--managed-mode): Use eglot--flymake-reset.
(eglot--maybe-activate-editing-mode): Don't reset Flymake things here.
(eglot--code-action-params): Tweak.
(eglot--code-action-bounds): Use eglot--flymake-sniff-diagnostics.
(eglot--capf-session-flush): Tweak.