1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-25 05:52:42 -08:00
Commit graph

99533 commits

Author SHA1 Message Date
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
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
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
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
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
Daniel Mendler
94051b2c9a Call browser functions via `browse-url'
This is in order to apply `browse-url-transform-alist'.

* lisp/net/browse-url.el (browse-url-with-browser-kind)
(browse-url-button-open, browse-url-button-open-url):
* lisp/net/shr.el (shr-browse-url):
* lisp/net/eww.el (eww-browse-with-external-browser):
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url):
* lisp/emacs-lisp/package.el (package-browse-url): Let-bind
`browse-url-browser-function' and call `browse-url'.
2026-01-20 10:31:03 +00:00
Pranshu Sharma
95775d9338 Factor out calculation of window combination for 'split-frame'
* lisp/window-x.el (window--get-split-combination): New function.
(split-frame): Call it.
2026-01-20 09:26:55 +01:00
Juri Linkov
5eb9800c42 Allow non-interactive calls of 'goto-line' (bug#80150)
* lisp/simple.el (goto-line, goto-line-relative): Add new arg 'interactive'.
Remove 'declare' with 'interactive-only'.  Don't push the mark when called
non-interactively.
2026-01-19 20:39:27 +02:00
Juri Linkov
86c40dcc31 Don't fail in minibuffer--completions-visible for undefined reference buffer
* lisp/minibuffer.el (minibuffer--completions-visible):
Return 'window' even when 'completion-reference-buffer' is nil (bug#80064).
2026-01-19 20:27:50 +02:00
Michael Albinus
31c07d873b ; Minor Tramp cleanup
* lisp/net/tramp-adb.el:
* lisp/net/tramp-androidsu.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-smb.el: Do not delay
`connection-local-set-profiles' until after loading `shell'.

* lisp/net/tramp-integration.el: Add the local profile for all
hosts listed in `tramp-local-host-names'.

* lisp/net/tramp.el (tramp-local-host-names): New defvar.
(tramp-local-host-regexp): Use it.

* test/lisp/net/tramp-tests.el (tramp-test03-file-name-defaults):
Adapt test.
2026-01-19 12:28:18 +01:00
Philip Kaludercic
aff85304d9
Have 'package-find-news-file' handle built-in packages
* lisp/emacs-lisp/package.el (package-find-news-file): Abort
early if the package is built-in.
(describe-package-1): Do not invoke 'package-find-news-file' if
missing a package descriptor.
2026-01-18 22:14:54 +01:00
Philip Kaludercic
f263d2454f
; Fix type error in 'describe-package-1'
* lisp/emacs-lisp/package.el (describe-package-1): Pass the
package descriptor instead of a symbol to 'package-find-news-file'.

(Bug#80220)
2026-01-18 21:50:02 +01:00
Philip Kaludercic
3c125e2414
Portable escape SWITCHES in 'package-review-diff-command'
* lisp/emacs-lisp/package.el (package-review-diff-command): Use
'shell-quote-argument' to quote arguments instead of assuming a
POSIX shell.
2026-01-18 20:49:29 +01:00
Philip Kaludercic
0c31ea113f
Improve type of user option 'package-review-policy'
* lisp/emacs-lisp/package.el (package-review-policy): Move tags
to the cons-cell level, so that the labels are displayed in the
menu when inserting a new item.
2026-01-18 19:38:45 +01:00
Wilson Snyder
72a34eceb9 verilog-mode.el: Fix parameter replacements in AUTOINST.
* lisp/progmodes/verilog-mode.el (verilog-auto-inst-port): Fix
parameter replacements in AUTOINST (#1903).
2026-01-18 09:59:17 -05:00
Eli Zaretskii
313791e017 ; Fix messages in "M-x man"
* lisp/man.el (Man-getpage-in-background): Fix message in
synchronous case.
2026-01-18 14:36:51 +02:00
Michael Albinus
c91c0663e5 Fix `Man-shell-file-name'
* lisp/man.el (Man-shell-file-name): Fix for MS Windows.
(Bug#80212)
2026-01-18 12:47:47 +01:00
Philip Kaludercic
6fab8c009e
Extract "news" file extraction logic
* lisp/emacs-lisp/package.el (package-review)
(describe-package-1): Use new function.
(package-find-news-file): Add new function that also checks for
the "NEWS-elpa" file name.
2026-01-18 12:18:51 +01:00
Philip Kaludercic
e13046628d
Autoload 'package-delete'
* lisp/emacs-lisp/package.el (package-delete): Add autoload
cookie.  (Bug#80178)
2026-01-18 01:09:39 +01:00
Philip Kaludercic
ca69411e3d
Autoload 'package-browse-url'
* lisp/emacs-lisp/package.el (package-browse-url): Add autoload
cookie.  (Bug#80178)
2026-01-17 23:39:48 +01:00
Philip Kaludercic
f1f1898f0c
Remove some mode restriction in interactive specs of package.el
* lisp/emacs-lisp/package.el (package-browse-url)
(package-report-bug): Do not restrict these commands to
'package-menu-mode'.  (Bug#80178)
2026-01-17 23:38:09 +01:00
Philip Kaludercic
674fbfdd9e
Remove rcirc-set-{en,de}code-coding-system aliases
These were in the wrong order anyway, so they never had any
effect.

* lisp/net/rcirc.el (rcirc-set-decode-coding-system)
(rcirc-set-encode-coding-system): Remove obsoletion aliases.
(Bug#80145)
2026-01-17 20:18:05 +01:00
Philip Kaludercic
18a5151cd1
Add a default "Subject" for package reviews
* lisp/emacs-lisp/package.el (package-review): Set the SUBJECT
parameter when calling 'compose-mail'.
2026-01-17 18:58:09 +01:00
Philip Kaludercic
60ed7688b5
Quote diff when reviewing package
* lisp/emacs-lisp/package.el (package-review): Run
'comment-region' on the output of diff.
2026-01-17 18:58:09 +01:00
Sean Whitton
da9792166b ; * lisp/ldefs-boot.el: Regenerate. 2026-01-17 17:20:22 +00:00
Sean Whitton
852ca2ff40 Disable diff-restrict-view by default
* lisp/vc/diff-mode.el (diff-restrict-view): Disable it.
* etc/NEWS: Announce the change.
2026-01-17 17:17:52 +00:00
Sean Whitton
6e4bceb8ce Automatically detect the VC outgoing base (bug#80006)
* lisp/vc/vc-git.el (vc-git--current-branch): Rename to ...
(vc-git-working-branch): ... this.  All uses changed.
(vc-git-trunk-or-topic-p, vc-git-topic-outgoing-base):
* lisp/vc/vc-hg.el (vc-hg--working-branch, vc-hg-working-branch)
(vc-hg-trunk-or-topic-p, vc-hg-topic-outgoing-base):
* lisp/vc/vc-hooks.el (vc--safe-branch-regexps-p):
* lisp/vc/vc.el (vc-default-working-branch)
(vc-default-trunk-or-topic-p, vc--match-branch-name-regexps)
(vc--outgoing-base, vc--outgoing-base-mergebase)
(vc--maybe-read-outgoing-base): New functions.
(vc-diff-outgoing-base): Call vc--outgoing-base-mergebase.
(vc-root-diff-outgoing-base, vc-diff-outgoing-base): Use
vc--maybe-read-outgoing-base in interactive specification.
(working-branch, trunk-or-topic-p, topic-outgoing-base): New
specifications for backend functions.
(vc-trunk-branch-regexps, vc-topic-branch-regexps): New
variables.
* .dir-locals.el: Commented entries for the new variables.
* test/lisp/vc/vc-tests/vc-test-misc.el
(vc-test-match-branch-name-regexps): New test.
* doc/emacs/vc1-xtra.texi (Outstanding Changes): Document the
new functionality.
2026-01-17 17:17:51 +00:00
kobarity
83b4f1ba26 Performance improvement of 'python-shell-get-process'
'python-shell-get-process' is frequently called from
'python-eldoc--get-doc-at-point' and etc., invoking
'project-current' unless there is a buffer-specific Inferior
Python process.  When the buffer is a remote buffer not
belonging to any project and has significant latency,
'project-current' may take a long time.  To avoid this,
implement a process cache in 'python-shell-get-process'.

* lisp/progmodes/python.el (python-shell--process-cache)
(python-shell--process-cache-valid): New variables.
(python-shell--invalidate-process-cache): New function.
(python-shell-make-comint): Add a call to the above function.
(python-shell-get-process): Add process cache.  (Bug#80045)
2026-01-17 18:09:03 +02:00
Jostein Kjønigsen
83f4e48106 csharp-mode.el: Fix indentation after preprocessor statements
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules):
Add rules for preprocessor statements.  (Bug#80202)
2026-01-17 17:34:16 +02:00
Pig Fang
023bf05816 Eglot: support 'wat-mode'
* lisp/progmodes/eglot.el (eglot-server-programs): Add wat_server.
(Bug#80188)

Copyright-paperwork-exempt: yes
2026-01-17 17:02:19 +02:00
USAMI Kenta
c68c5fbe14 ; Remove redundant cl-lib runtime dependencies across lisp/
* lisp/editorconfig-tools.el:
* lisp/emacs-lisp/shorthands.el:
* lisp/info-xref.el:
* lisp/international/quail.el:
* lisp/international/rfc1843.el:
* lisp/mail/ietf-drums.el:
* lisp/mail/rfc2047.el:
* lisp/mail/yenc.el:
* lisp/net/pop3.el:
* lisp/net/sasl-scram-sha256.el:
* lisp/net/shr-color.el:
* lisp/progmodes/grep.el:
* lisp/scroll-bar.el:
* lisp/textmodes/emacs-news-mode.el:
* lisp/textmodes/reftex-auc.el:
* lisp/textmodes/reftex-dcr.el:
* lisp/textmodes/reftex-global.el:
* lisp/textmodes/reftex-sel.el:
* lisp/url/url-dav.el:
* lisp/vc/vc-src.el:
* lisp/xwidget.el:
* lisp/yank-media.el: Remove redundant (require 'cl-lib).
(Bug#80129)
2026-01-17 15:32:15 +02:00
USAMI Kenta
4efc4dcf30 ; Gnus: Remove redundant cl-lib runtime dependencies
Since Emacs 31 moves 'incf' and 'decf' to core, these Gnus
libraries no longer require 'cl-lib' at runtime.
* lisp/gnus/gnus-async.el:
* lisp/gnus/gnus-cache.el:
* lisp/gnus/gnus-logic.el:
* lisp/gnus/gnus-salt.el:
* lisp/gnus/gnus-spec.el:
* lisp/gnus/gnus-srvr.el:
* lisp/gnus/gnus-topic.el:
* lisp/gnus/gnus-uu.el:
* lisp/gnus/gnus-win.el:
* lisp/gnus/mm-encode.el:
* lisp/gnus/mm-url.el:
* lisp/gnus/nnatom.el:
* lisp/gnus/nnbabyl.el:
* lisp/gnus/nndoc.el:
* lisp/gnus/nneething.el:
* lisp/gnus/nnmail.el:
* lisp/gnus/nnoo.el:
* lisp/gnus/nnspool.el:
* lisp/gnus/nnvirtual.el:
* lisp/gnus/nnweb.el: Remove redundant (require 'cl-lib).
(Bug#80129)
2026-01-17 15:28:58 +02:00
Daniel Mendler
b04fbc59e9 gnus-msg-mail: Attempt to start Gnus if not yet alive
* lisp/gnus/gnus-msg.el (gnus-msg-mail): Attempt to start Gnus
if not yet alive.  In case of failure, fall back to plain
message mode.  (Bug#80173)
2026-01-17 15:08:52 +02:00
kobarity
c97b8e6650 Improve non-native completion in Python mode
Previously, both the definition of __PYTHON_EL_get_completions
and the call to __PYTHON_EL_get_completions were sent to the
inferior Python each time
'python-shell-completion-get-completions' was executed.
However, there is no need to send the definition every time as
long as the definition remains unchanged.  We improved this so
that the definition of __PYTHON_EL_get_completions is only sent
during the inferior Python initialization; it is no longer sent
during 'python-shell-completion-get-completions' execution.
* lisp/progmodes/python.el
(python-shell-completion-send-setup-code): New function.
(python-shell-first-prompt-hook): Add the above new function.
(python-shell-completion-get-completions): Omit sending
'python-shell-completion-setup-code'.  (Bug#80182)
2026-01-17 15:05:33 +02:00