Commit graph

180949 commits

Author SHA1 Message Date
Leo C. Stein
11d26dccde Add a few missing mathematical brackets to TeX input method
* lisp/leim/quail/latin-ltx.el: Add a few more left/right brackets,
especially the ones whose names in ucs-names start with MATHEMATICAL.
The macro names are taken from unimath-symbols.pdf, available at
http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unimath-symbols.pdf
2026-01-24 12:43:57 +02:00
Leo C. Stein
4de7ddc837 Add unicode's mathematical alphabets to TeX input method
* lisp/leim/quail/latin-ltx.el: Add math "alphabets" that can be matched
with simple regexps; a few others are added by hand.  There are 13
variants: bf, it, bfit, bb, scr, bfscr, frak, bffrak, sf, bfsf, sfit,
bfsfit, and tt.
2026-01-24 12:43:18 +02:00
Leo C. Stein
b1f7d6254a Add some missing LaTeX macros to TeX input method
* lisp/leim/quail/latin-ltx.el (latin-ltx--define-rules): Add standard
TeX names that were missing; some already had other aliases.  Add a few
other non-systematic additions.
2026-01-24 12:42:25 +02:00
Josh Berdine
0ca00d9a98 Use math symbols instead of CJK punctuation in TeX input method
This seems more appropriate given the context, and additionally
the CJK symbols often render wider, as a full width CJK glyph,
while the math symbols render narrower.  There was some related
discussion in bug#12948, where an analogous change was made
for \langle and \rangle.
* lisp/leim/quail/latin-ltx.el (latin-ltx--define-rules):
Change rules for \llbracket, \rrbracket and \ldata, \rdata to
generate Unicode code points in the Miscellaneous Mathematical
Symbols-A block (U+27E6, U+27E7 and U+27EA, U+27EB) instead of
the CJK Symbols and Punctuation block (U+301A, U+301B and
U+300A , U+300B).

Copyright-paperwork-exempt: yes
2026-01-24 12:40:29 +02:00
Dmitry Gutov
3573116d3e ; Fix indentation in project.el 2026-01-24 06:48:29 +02:00
Dmitry Gutov
b7d4681908 Stop project-query-replace-regexp failing on directory symlinks
* lisp/progmodes/project.el (project--files-safe): New function.
(project-search, project-query-replace-regexp): Use it (bug#78209).
2026-01-24 06:45:32 +02:00
Mattias Engdegård
3b547e4f5d * lisp/emacs-lisp/pcase.el (pcase--macroexpand): Normalise atom etc.
Transform (pred P) for P in {atom, nlistp, identity, not} into
predicates that pcase already understands in type terms.
This doesn't affect the behaviour but generates better code.
2026-01-23 16:46:34 +01:00
Mattias Engdegård
cd8c85c4fd * test/Makefile.in (SLOW_TESTS): add package-vc-tests (bug#80235) 2026-01-23 16:46:34 +01:00
Sean Whitton
29bdba37f2 New bindings for vc-revert
* lisp/vc/vc-dir.el (vc-dir-mode-map): Bind vc-revert to '@'.
* lisp/vc/vc-hooks.el (vc-prefix-map): Additionally bind
vc-revert to 'C-x v @'.
* doc/emacs/maintaining.texi (VC Undo, VC Directory Commands):
* etc/NEWS: Document the change.
2026-01-23 14:11:27 +00:00
Sean Whitton
644caa944d ; Autoload pixel-scroll-interpolate- commands.
It is useful to bind these to [remap scroll-up-command] and
[remap scroll-down-command] even if you don't want to enable
pixel-scroll-precision-mode because of how it sets
make-cursor-line-fully-visible.
2026-01-23 13:40:31 +00:00
Juri Linkov
b4a5948d33 ; Remove "--" from the name of autoloaded 'window--get-split-combination'
* lisp/window-x.el (window-get-split-combination, split-frame):
* lisp/tab-bar.el (tab-bar-split-tab):
Rename 'window--get-split-combination' to 'window-get-split-combination'.
2026-01-22 20:09:47 +02:00
Stefan Monnier
8ccab6bf06 lisp/simple.el (goto-line): Minor optimization 2026-01-22 12:58:53 -05:00
Eli Zaretskii
7b9d3e90ce Fix MS-Windows build broken by recent updates in MinGW64 headers
* nt/inc/ms-w32.h (strerror): Redirect to sys_strerror after
including <string.h>, to prevent the linker from thinking it
should be imported from some DLL.  Reported by Richard Copley
<rcopley@gmail.com>.

* src/w32.c: Remove now unneeded prototype of sys_strerror.
2026-01-22 19:36:54 +02:00
Eli Zaretskii
5290b5dddb ; Fix :type of 'yaml-ts-mode-yamllint-options'
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode-yamllint-options):
Fix :type and doc string.
2026-01-22 14:52:12 +02:00
Mattias Engdegård
45089f9588 * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Speed up.
Manicure pcase patterns to avoid performance-sapping internal functions
and switch-breaking gaps, resulting in smaller code and less allocation.
2026-01-22 10:56:59 +01:00
Michael Albinus
2696eff451 ; * test/lisp/net/dbus-tests.el: Fix typos. 2026-01-22 09:58:37 +01:00
Juri Linkov
a0197aef96 Restrict the 'buffer' arg of 'goto-line' only to interactive uses
* lisp/simple.el (goto-line): Use 'buffer' arg only when
'interactive' is non-nil (bug#80150).  Update docstring.
2026-01-22 09:37:14 +02:00
João Távora
f2250ba244 Eglot: simplify Imenu setup again
See https://github.com/joaotavora/eglot/issues/1569.

* lisp/progmodes/eglot.el (eglot--managed-mode): Tweak.

* etc/EGLOT-NEWS: Tweak.
2026-01-21 23:09:19 +00:00
João Távora
10b132006e Eglot: display more readable server-originated messages
* lisp/progmodes/eglot.el (eglot--format-server-message): New helper.
(eglot-handle-notification<window/showMessage>)
(eglot-handle-request<window/showMessageRequest>): Use it.
2026-01-21 23:08:39 +00:00
Juri Linkov
41c0d254d5 ; * lisp/textmodes/yaml-ts-mode.el: Fix docstring wider than 80 characters. 2026-01-21 20:08:14 +02:00
Juri Linkov
8063921808 Fix down-list navigation in python-ts-mode
* lisp/progmodes/python.el (python-ts-mode):
Set 'treesit-sexp-thing-down-list' to 'list' to override
sexp navigation with list navigation (bug#72478).

* lisp/emacs-lisp/lisp.el (up-list): Mention 'up-list-function' in docstring.
2026-01-21 20:02:56 +02:00
Vincenzo Pupillo
15d3cc3f65 Flymake support for yaml-ts-mode.
* 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.
2026-01-21 19:41:40 +02:00
Binbin Ye
8ea6f6da77 Add JSON path utility command to json-ts-mode
* 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).
2026-01-21 19:27:03 +02:00
Eli Zaretskii
d4dbce74a7 Fix updating buffer menu after invoking "M-x term"
The doc string of 'frame-or-buffer-changed-p' says not to call it
with the nil argument, but term.el did.  Since "M-x term" puts
'term--update-term-menu' on the 'menu-bar-update-hook' ahead of
'menu-bar-update-buffers', it caused the latter decide that there
was no change in buffers, because the internal state variable
used by 'frame-or-buffer-changed-p' when called with the nil
argument was reset by 'term--update-term-menu'.  Fix that by using
a non-nil state variable.
* lisp/term.el (term--buffers-changed): New variable.
(term--update-term-menu): Use it when calling
'frame-or-buffer-changed-p'.  (Bug#80231)
2026-01-21 17:37:33 +02:00
Mattias Engdegård
fe2469c1c1 ; * test/lisp/net/dbus-tests.el: hush warnings on no-dbus platforms 2026-01-21 16:22:05 +01:00
João Távora
9d8e1af6f4 Eglot: fix textDocument/prepareRename support
Can't send prepareRename requests willy-nilly.

See https://github.com/joaotavora/eglot/issues/1554.

* lisp/progmodes/eglot.el (eglot--rename-interactive): Fix.
(eglot-client-capabilities): Advertise "prepareSupport".

* etc/EGLOT-NEWS: Mention change.
2026-01-21 12:26:24 +00:00
João Távora
f643ad53c7 Eglot: set imenu-create-index-function without advice
See https://github.com/joaotavora/eglot/issues/1569.

* lisp/progmodes/eglot.el (eglot--managed-mode): Stomp on
imenu-create-index-function conditionally.
(eglot-imenu): Don't check eglot-server-capable here.

* etc/EGLOT-NEWS: Mention change.
2026-01-21 12:26:24 +00:00
João Távora
d3548aea96 Eglot: limit the number of file watches
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.
2026-01-21 12:26:24 +00:00
João Távora
a3ea65a984 Eglot: support more complex workspace edits (create/rename/delete)
Advertise support for file resource operations in workspace edits.
Implement create, rename, and delete file operations.  Rework
confirmation UI to handle mixed operation types.

* lisp/progmodes/eglot.el (eglot--lsp-interface-alist): Add
CreateFile, RenameFile, DeleteFile interfaces.
(eglot-client-capabilities): Advertise resourceOperations and
failureHandling.
(eglot-handle-request<workspace/applyEdit>): Return failureReason.
(eglot--apply-text-edits): Tweak error message.
(eglot--propose-changes-as-diff): Adjust for new prepared format.
Return buffer.
(eglot--apply-workspace-edit): Rework.  Handle file operations.

* etc/EGLOT-NEWS: Mention change.
2026-01-21 12:26:24 +00:00
João Távora
f02a120f18 Eglot: overhaul eglot-confirm-server-edits defcustom
Now also accepts file operation kinds as keys in the alist form.

* lisp/progmodes/eglot.el (eglot-confirm-server-edits): Rework
default value, docstring and defcustom type.
(eglot--confirm-server-edits): Also check for operation-kind-based
entries.
2026-01-21 12:26:24 +00:00
João Távora
b40e89e523 Eglot: default eglot-advertise-cancellation to t
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.
2026-01-21 12:26:24 +00:00
João Távora
155f524f03 Eglot: handle user quits when applying server-initiated edits
If the user simply C-g's signal a 'jsonrpc-error' with code 32000 to
mean "no error", provide an LSP :failureReason and keep server chill.

* lisp/progmodes/eglot.el (eglot-handle-request<workspace/applyEdit>>):
2026-01-21 12:26:24 +00:00
João Távora
7216d7ff87 Eglot: ensure no timeout on remote command executions
Else, if the server asks us a question, the user has just 10
seconds to ponder, which is a bit silly.

* lisp/progmodes/eglot.el (eglot-execute): Pass timeout=nil to
eglot--request.
2026-01-21 12:26:24 +00:00
João Távora
0917169782 Eglot: slightly friendlier UI for server window/showMessageRequest
Previously, the default answer pre-filled in the minibuffer was
obscuring the other possible answers.

* lisp/progmodes/eglot.el
(eglot-handle-request<window/showMessageRequest>): Rework.
2026-01-21 12:26:24 +00:00
João Távora
ff5bab9552 Eglot: advertise cancellation on eglot--request quits
* lisp/progmodes/eglot.el (eglot--request): Pass CANCEL-ON-QUIT
to jsonrpc-request.
2026-01-21 12:26:24 +00:00
João Távora
81b7e8e927 Eglot: fix async request cancellation
It was completely broken, with a cancel being set for every sent (and
probably already received) async request, and no actual discarding
of the response of a cancelled request.

* lisp/progmodes/eglot.el (eglot--async-request): Fix cancellation
of async requests.
(eglot--semtok-request): Don't need 'buf' &aux anymore.
2026-01-21 12:26:24 +00:00
João Távora
977e354709 Eglot: treat code=0 JSONRPC errors as benign
* lisp/progmodes/eglot.el (eglot--request): Shoosh code=0 errors.
(eglot-mode-line-error): Check for code=0.
2026-01-21 12:26:24 +00:00
João Távora
adb605716f Jsonrpc: don't let remote endpoint requests go unanswered
Previously, 'quit' could cause remote endpoints to never get a
reply and thus sometimes hang.  Ensure we always reply.  Also,
give the application a chance to signal jsonrpc-error with the
served code=32000, meaning "no error".

* doc/lispref/text.texi (JSONRPC Overview): Rework section on
request dispatchers.

* lisp/jsonrpc.el (jsonrpc-connection-receive): Rework.
2026-01-21 12:26:24 +00:00
João Távora
7ce09a741a Jsonrpc: allow control over jsonrpc-request quits
This allows clients such as Eglot to act on the user
C-g's/quits out of a blocking jsonrpc-request call.  It also
fixes the TIMEOUT=nil passed to jsonrpc-request.  An infinite
timeout in that case (for a long-running request, for example)
and it was not being transmitted to the lower
jsonrpc-async-request.

* lisp/jsonrpc.el (jsonrpc-request): Add CANCEL-ON-QUIT.  Rework
docstring.
2026-01-21 12:26:23 +00:00
Mattias Engdegård
b364c42a0e ; * doc/lispref/internals.texi (Garbage Collection): typo 2026-01-21 12:45:44 +01:00
Eli Zaretskii
ac8bc9a2e2 ; * src/alloc.c (Fgarbage_collect_heapsize): Avoid compiler warning. 2026-01-21 13:44:31 +02:00
Martin Rudalics
2d758e73eb Fix thinko in 'quit-restore-window'
* lisp/window.el (quit-restore-window): Try to restore the
previously selected window only if WINDOW is either the selected
window or BURY-OR-KILL is neither 'burying' nor 'killing'.
Otherwise, this might deliberately change the selected window,
for example, when 'kill-buffer-quit-windows' is non-nil and WINDOW
shows the buffer to kill.
2026-01-21 11:14:36 +01:00
Morgan Smith
0d448871be * doc/misc/dbus.texi (Inhibitor Locks): Fix path. 2026-01-21 09:24:52 +01:00
Elías Gabriel Pérez
ff64470139 hideshow: Use 'message' instead of 'user-error'. (Bug#80201)
Using 'user-error' in 'hs-minor-mode', prevents the major-mode
from initializing correctly when hideshow is not supported in
that mode, using 'message' instead fixes this.

* lisp/progmodes/hideshow.el (hs-minor-mode): Tweak.
2026-01-21 09:46:23 +02:00
Jared Finder
75dd442058 (xterm--init): Fix probem in async mode (bug#80163)
In async mode, the workaround for the old Terminal.app collides
with the binding we install for the primary DA.  Just drop it.

* lisp/term/xterm.el (xterm--init): Remove workaround for very old
macOS `Terminal.app`.
2026-01-20 22:46:31 -05:00
Stefan Monnier
4150c2e22e (garbage-collect-heapsize): New function
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`.
2026-01-20 16:09:22 -05:00
Juri Linkov
9ba2f13176 * lisp/tab-bar.el (tab-bar-split-tab): New command.
(split-tab): Alias for 'tab-bar-split-tab'.
2026-01-20 19:32:16 +02:00
Daniel Mendler
2fc549f3b4 ; * lisp/net/browse-url.el (browse-url-with-browser-kind): Fix call. 2026-01-20 14:44:49 +00:00
Michael Albinus
a32ee5026b Extend Tramp traces
* lisp/net/tramp-message.el (tramp-debug-message):
Change selection for `trace-function-background'.
2026-01-20 12:31:51 +01:00
Michael Albinus
8f96f5ffb5 Tag Tramp tests as :expensive-test
* test/lisp/net/tramp-tests.el (tramp-test03-file-name-defaults)
(tramp-test10-write-region-file-precious-flag)
(tramp-test10-write-region-other-file-name-handler)
(tramp-test16-file-expand-wildcards)
(tramp-test17-dired-with-wildcards)
(tramp-test17-insert-directory-one-file)
(tramp-test33-environment-variables-and-port-numbers)
(tramp-test35-remote-path, tramp-test39-make-lock-file-name)
(tramp-test39-detect-external-change, tramp-test42-utf8)
(tramp-test43-file-system-info)
(tramp-test44-file-user-group-ids, tramp-test48-session-timeout)
(tramp-test49-external-backend-function)
(tramp-test50-recursive-load): Tag them as :expensive-test.  (Bug#80164)
2026-01-20 12:30:48 +01:00