1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00
Commit graph

99136 commits

Author SHA1 Message Date
Sean Whitton
0f90cc033d ; * lisp/progmodes/project.el (project-compile): Fix last change. 2025-11-30 18:32:51 +00:00
Sean Whitton
30e178e7cb * lisp/vc/vc.el (vc-push): Clear cached incoming revision. 2025-11-30 18:31:37 +00:00
Sean Whitton
2abad90dce * lisp/vc/vc.el (vc--incoming-revision): Don't cache 'nil'. 2025-11-30 18:28:55 +00:00
Juri Linkov
0f9dd5b3a1 Show Flymake diagnostics on clicking mouse-1 on the mode-line indicator
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
Bind [mode-line mouse-1] to 'flymake-show-buffer-diagnostics' (bug#76254).
2025-11-30 20:24:34 +02:00
Sean Whitton
5167989b2a Cache VC incoming revisions
* lisp/vc/vc-hooks.el (vc-file-setprop): Use cl-pushnew.
(vc--repo-setprop, vc--repo-getprop, vc--repo-clearprops): New
functions.
* lisp/vc/vc.el (vc--incoming-revision): Cache incoming
revisions.
* src/fns.c (Fput): State that VALUE is returned.
2025-11-30 18:20:50 +00:00
Juri Linkov
9174bc811a Use treesit-extra-load-path for more values of treesit-auto-install-grammar
* lisp/treesit.el (treesit-auto-install-grammar): Use the first
writable directory from 'treesit-extra-load-path' for values
'always', 'ask', 'ask-dir' (bug#79862).

* src/treesit.c (syms_of_treesit): Extend docstring.
2025-11-30 20:14:19 +02:00
Sean Whitton
16b19ceb28 project-compile: Don't let-bind compile-command
* lisp/progmodes/project.el (project-compile): Handle ignoring
compile-command from a vc-compilation-mode buffer in a way that
does not involve let-binding compile-command.
2025-11-30 17:36:33 +00:00
João Távora
27f0a3fd86 Eglot: revert changes to eglot-rename's interface (bug#79757)
After some weeks of testing, I've changed by mind on this.  Having the
current name appear passed the INITIAL-VALUE to read-from-minibuffer is
a jarring backward-incompatible change.  There is no evidence that the
majority of renames are simple tweaks to the existing names, and even
less evidence that these tweaks happen frequently at the end of the
symbol.

Therefore it's better for the ergonomics of this commonly used command
to leave the code as it was and simply rely on C-n to bring in the
default value (which is the current symbol name), instead of forcing
users accustomed to the previous behaviour remember to press sth like
M-DEL to clean the input.

* lisp/progmodes/eglot.el (eglot-rename): Tweak.
2025-11-30 13:52:30 +00:00
Sean Whitton
ae36ee3655 ; * lisp/server.el (server--process-filter-1): Fix typo. 2025-11-30 13:47:00 +00:00
Sean Whitton
7d2e22843f server--process-filter-1: Fix stripping -auth argument (bug#79889)
* lisp/server.el (server--process-filter-1): Strip trailing
space after -auth argument (bug#79889).  Fix due to Richard
Copley <rcopley@gmail.com>.
2025-11-30 11:24:32 +00:00
Roi Martin
b208b08371 Fix bug in semantic linefeed filling
Fix bug in semantic linefeed filling related to wide characters and
`sentence-end-without-space'.
* lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Fix the
calculation of the maximum column.  Do not depend on where
`fill-region-as-paragraph-default' leaves point after being called.
(Bug#79575)
2025-11-30 11:41:49 +02:00
Sean Whitton
c499c2f67b * lisp/vc/diff-mode.el (diff-filename-drop-dir): Match backslashes. 2025-11-29 18:21:31 +00:00
Stephen Gildea
9f2b1c43c9 time-stamp: return quicker when inactive
* lisp/time-stamp.el (time-stamp-once): Do not look for additional
templates once we have displayed the warning about being disabled.
Move earlier the check for arguments being the correct type.
* test/lisp/time-stamp-tests.el (time-stamp-custom-messages): New test.
2025-11-29 09:14:58 -08:00
Sean Whitton
1677c4681a Handle copying additions & removals between working trees
* lisp/vc/diff-mode.el (diff-file-kill): New optional DELETE
parameter.
(diff-kill-creations-deletions):
* lisp/vc/vc.el (vc--fileset-by-state): New functions.
(diff-kill-creations-deletions, diff-filename-drop-dir)
(diff-hunk-file-names, diff-file-next, diff-hunk-header-re)
(vc-dir-resynch-file): Declare.
(vc--apply-to-other-working-tree): Handle copying and moving
files in the added, removed, missing and unregistered states.
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--apply-to-other-working-tree): New test.
2025-11-29 14:35:39 +00:00
Sean Whitton
917f5e25de Fix vc-git-uncommit-revisions-from-end
* lisp/vc/vc-git.el (vc-git-uncommit-revisions-from-end): Don't
leave changes staged.
2025-11-29 14:29:58 +00:00
Sean Whitton
577821f143 * lisp/vc/vc-svn.el (vc-svn-state): Handle FILE with no directory. 2025-11-29 14:29:35 +00:00
Eli Zaretskii
ad8ced8bbb ; * lisp/cus-start.el (native-p): Update for treesit options. 2025-11-29 07:56:41 -05:00
Eli Zaretskii
029d87a810 ; * lisp/emacs-lisp/seq.el (seq-reduce): Restore lost sentence. 2025-11-29 07:12:56 -05:00
Eli Zaretskii
19f0b0e1e8 Merge from origin/emacs-30
a74b693683 Clarify use of ':font' in face-remapping functions
5c0d2ca79a ; cl-reduce, seq-reduce: Improve wording.

# Conflicts:
#	lisp/emacs-lisp/seq.el
2025-11-29 07:08:38 -05:00
Eli Zaretskii
d65423306a ; Fix byte-compiler warning in treesit.el
* lisp/treesit.el (treesit-declare-unavailable-functions): Declare
'treesit-extra-load-path'.
2025-11-29 07:04:42 -05:00
Eli Zaretskii
ae4416f8f7 eglot: add "ty" LSP server for Python to 'eglot-server-programs'
* lisp/progmodes/eglot.el (eglot-server-programs): Add "ty" LSP
server for Python.  Patch by Steve Purcell <steve@sanityinc.com>.
2025-11-29 13:21:56 +02:00
Rudolf Adamkovič
6743a7d747 Add current subject to future history in `message-change-subject'
* lisp/gnus/message.el (message-change-subject): Read the new subject
with the old subject in the "future history".
* etc/NEWS (minutes): Announce the feature.  (Bug#79815)
2025-11-29 12:49:12 +02:00
Eli Zaretskii
a74b693683 Clarify use of ':font' in face-remapping functions
* lisp/face-remap.el (face-remap-add-relative)
(face-remap-set-base, buffer-face-set, buffer-face-toggle)
(buffer-face-mode-invoke): Clarify how to use ':font' in face
attribute lists.  (Bug#79906)
2025-11-29 11:25:02 +02:00
João Távora
a542ed23e4 Eglot: re-do semantic tokens again (bug#79374)
After a week of intense testing, found out there were various insidious
bugs related to out-of-date requests that rear their heads in different
typing patterns.  One way to sort this out and still minimize the number
of requests is to have Eglot's semtok code be aware of the states a
request for tokens can be in: inexistent/invalid, unsent, sent, valid.

The needs and optimization opportunities for servers that support "full"
and "full/delta" requests are considerably different from the ones of
servers which only support "full" and "range".  The latter seem to be in
the minority, so for now I've removed the range requests.  These servers
should still work with "full" requests.

In a further bug, at least two servers (clangd and lean) were found to
plainly abuse the semanticTokens/refresh server request.  This confuses
the state logic.  The solution is to simply no-op this request handler,
it doesn't seem to do anything useful.

Finally, when auto-reverting with preserve-modes (as done by vc-revert
and auto-revert-mode), the font-lock state needs to be reinitialized.
Fixed this in eglot--after-revert-hook.

* lisp/progmodes/eglot.el (eglot-client-capabilities): Don't announce
ranged request support.
(eglot--docver): Rename from eglot--versioned-identifier.
(eglot--diagnostics)
(eglot--flymake-diagnostics)
(eglot-handle-notification)
(eglot--signal-textDocument/didOpen)
(eglot--report-to-flymake)
(eglot--apply-text-edits)
(eglot--VersionedTextDocumentIdentifier): Use eglot--docver.
(eglot--send-changes-hook): Rename from eglot--document-changed-hook.
(eglot--after-change): Don't run eglot--send-changes-hook here.
(eglot--signal-textDocument/didChange): Run it here.
(eglot--semtok-state): Rename from eglot--semtok-cache.
(eglot--semtok-inflight): Delete.
(eglot--handle-request semanticTokens/refresh): Nullify.
(eglot-semantic-tokens-mode): Tweak.
(eglot--semtok-after-send-changes): New hook.
(eglot--semtok-request)
(eglot--semtok-font-lock): Rewrite.
(eglot--after-revert-hook): Reinitialize semtok state.

Co-authored-by: Lua Viana Reis <me@lua.blog.br>
2025-11-28 21:32:20 +00:00
João Távora
80a84130a4 ; Eglot: remove/address a FIXME added by Stefan Monnier
According to the commit msg of:

   commit 0816da8e78
   Author: João Távora <joaotavora@gmail.com>
   Date:   Mon Oct 21 16:07:38 2019 +0100

This is needed because M-x vc-revert preserves (or used to
preserve) major modes on revert.

* lisp/progmodes/eglot.el (eglot--after-revert-hook): Remove FIXME
comment.
2025-11-28 21:24:56 +00:00
Michael Albinus
6346f5b053 Sync with Tramp 2.8.0.5
* doc/misc/tramp.texi (Remote processes): Improve description
where direct asyn processes won't work.

* lisp/net/tramp-cache.el (with-tramp-saved-connection-properties):
Adapt `tramp-verbose' less aggressive.

* lisp/net/tramp-container.el (tramp-kubernetes--context-namespace):
Use `string-join'.

* lisp/net/tramp-message.el (tramp-get-debug-file-name):
Modify debug file name.
(tramp-debug-message): Simplify.

* lisp/net/tramp-sh.el (tramp-actions-before-shell)
(tramp-actions-copy-out-of-band):
Add `tramp-keyboard-interactive-authentication-prompt-regexp'.

* lisp/net/tramp.el (tramp-encoding-shell): Fix docstring.
(tramp-keyboard-interactive-authentication-prompt-regexp): New defcustom.
(tramp-action-ignore-message): New defun.

* test/lisp/net/tramp-tests.el (tramp-test10-write-region)
(tramp-test10-write-region-file-precious-flag)
(tramp-test10-write-region-other-file-name-handler)
(tramp-test27-load, tramp-test32-shell-command)
(tramp-test32-shell-command-dont-erase-buffer)
(tramp-test34-connection-local-variables)
(tramp-test36-vc-registered, tramp-test39-make-lock-file-name)
(tramp-test39-detect-external-change)
(tramp-test45-asynchronous-requests): Adapt tests.
2025-11-28 17:38:36 +01:00
Sean Whitton
5c0d2ca79a ; cl-reduce, seq-reduce: Improve wording. 2025-11-28 12:10:55 +00:00
Yuan Fu
2c19f6087e
Remove the cached values in tree-sitter modes (bug#79363)
The cached values are not needed anymore since Emacs now caches
the compiled queries.

* lisp/progmodes/cmake-ts-mode.el:
(cmake-ts-mode--indent-rules-cached): Remove.
(cmake-ts-mode--indent-rules): Return values directly.
(cmake-ts-mode--font-lock-settings-cached): Remove.
(cmake-ts-mode--font-lock-settings): Return values directly.
* lisp/progmodes/php-ts-mode.el:
(php-ts-mode--font-lock-settings-cached): Remove.
(php-ts-mode--font-lock-settings): Return values directly.
(php-ts-mode--custom-html-font-lock-settings-cached): Remove.
(php-ts-mode--custom-html-font-lock-settings): Return values directly.
* lisp/textmodes/mhtml-ts-mode.el:
(mhtml-ts-mode--treesit-font-lock-settings-cached): Remove.
(mhtml-ts-mode--treesit-font-lock-settings): Return values directly.
(mhtml-ts-mode--treesit-indent-rules-cached): Remove.
(mhtml-ts-mode--treesit-indent-rules): Return values directly.
* lisp/progmodes/cmake-ts-mode.el:
(cmake-ts-mode--indent-rules-cached): Remove
(cmake-ts-mode--indent-rules): Return values directly.
(cmake-ts-mode--font-lock-settings-cached): Remove.
(cmake-ts-mode--font-lock-settings): Return values directly.
* lisp/progmodes/csharp-mode.el:
(csharp-ts-mode--font-lock-settings-cached): Remove.
(csharp-ts-mode--font-lock-settings): Return values directly.
2025-11-28 00:12:28 -08:00
Juri Linkov
a1ab5f429d * lisp/cus-start.el: Make 'treesit-extra-load-path' customizable.
* lisp/treesit.el (treesit-auto-install-grammar): Add the value 'ask-dir'.
(treesit-ensure-installed): When 'treesit-auto-install-grammar' is
'ask' or 'ask-dir', ask for the directory to install the grammar library
using the first writable directory of 'treesit-extra-load-path' as default.
Also add the provided directory to 'treesit-extra-load-path' afterwards.

* src/treesit.c (treesit-extra-load-path): In the docstring
mention the fact that the first directory is special (bug#79862).
2025-11-28 09:23:57 +02:00
Eli Zaretskii
a4c5e64b11 ; Rename a variable. 2025-11-28 08:45:02 +02:00
Spencer Baugh
e576dc7556 Support completion-eager-display in completing-read-multiple
Make completing-read-multiple do eager display of *Completions*
when the table requests it.

As a side-effect of the implementation, we now check again if
eager-display is enabled if we have to retry doing eager-display
due to being interrupted by user input.  This is mildly nicer
since it gives the completion table a little more control: for
example, maybe the table only wants to do eager-display if the
minibuffer is empty; this change makes that work better.

* lisp/minibuffer.el (completions--start-eager-display)
(completing-read-default): Move the code for checking whether to
do eager-display into completions--start-eager-display.
* lisp/emacs-lisp/crm.el (completing-read-multiple): Call
completions--start-eager-display (bug#79858).
2025-11-27 19:45:16 +02:00
Stefan Monnier
43bcf3c43b (display-buffer-overriding-action): Try and discourage abuse
* lisp/window.el (display-buffer-overriding-action): Document
the intended use in the deluded hope to reduce the current abuse.
2025-11-27 10:20:04 -05:00
Eli Zaretskii
4b4b48d019 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2025-11-27 13:43:17 +02:00
Eli Zaretskii
b6163d42d2 Improve the fix for 'd' command in 'query-replace'
* lisp/misearch.el (coding-system--for-buffer-diff): Move
definition from here...
* lisp/vc/diff.el (coding-system--for-buffer-diff): ...to here.
2025-11-27 13:42:01 +02:00
Sean Whitton
77f45c5db8 * lisp/vc/vc.el (vc--apply-to-other-working-tree): Use y-or-n-p. 2025-11-27 10:55:06 +00:00
Dmitry Gutov
702b16f999 Fix project-prompt-project-name with (choose a dir)
* lisp/progmodes/project.el (project-prompt-project-name):
Use correct equality check (bug#79894).
2025-11-27 12:27:22 +02:00
Pranshu Sharma
18a346da6a Add new commands 'merge-frames' and 'split-frame'
* lisp/window-x.el (merge-frames, split-frame): New commands.
* etc/NEWS: Announce new commands 'merge-frame' and
'split-frame'.
2025-11-27 09:34:14 +01:00
Philip Kaludercic
d74bcd7b2c
; Fix order in which 'package-dir-info' searches files
See https://mail.gnu.org/archive/html/emacs-devel/2025-11/msg00977.html.

* lisp/emacs-lisp/package.el (package-dir-info): Sort files by
length instead of by the default order.  This aligns the
intention, the implementation and the preceding comment.
2025-11-26 19:32:51 +01:00
Stefan Monnier
e10c4982dc Fix completion error in C-x RET f ut-8-d TAB
The core of the problem is that `completion-pcm--prepare-delim-re`
is designed to match a "delimiter" in the pattern but was misused
to match a sequence of delimiter chars in the completions.

* lisp/minibuffer.el (completion-pcm--delim-re): Rename from
`completion-pcm--prepare-delim-re` and change its calling convention.
(completion-pcm--segments->regex): Use it.
(completion-pcm-word-delimiters): Adjust accordingly.

* test/lisp/minibuffer-tests.el (completion-pcm--test-zerowidth-delim):
New test.
2025-11-26 09:53:19 -05:00
Aaron Jensen
16a7051888 Fix indentation of keyword argument arrays/hashes in ruby-mode
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Check for ':' and
'=>' as previous tokens, and handle symbols ending with ':' to
properly indent keyword argument arrays and hashes when
ruby-bracketed-args-indent is nil.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol):
Handle arrays/hashes that are children of 'pair' nodes (keyword
arguments) to ensure consistent indentation.

* test/lisp/progmodes/ruby-mode-resources/ruby-bracketed-args-indent.rb:
Add test cases for keyword argument arrays and hashes with both
symbol-colon and hash-rocket syntax.

When ruby-bracketed-args-indent is nil, arrays and hashes used as
keyword argument values now indent by ruby-indent-level from the
line start, matching the documented behavior and fixing inconsistent
indentation (bug#74517).

(https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00939.html)
2025-11-26 01:31:12 +02:00
Sean Whitton
47aec3cbc9 Make it easier to enable Abbrev mode by default
* lisp/cus-start.el: Make 'abbrev-mode' customizable.
* doc/emacs/abbrevs.texi (Abbrev Concepts):
* etc/NEWS:
* src/buffer.c (syms_of_buffer): <abbrev-mode>: Document
enabling Abbrev mode by default in all buffers by customizing
'abbrev-mode' to a non-nil value.
2025-11-25 22:08:19 +00:00
Sean Whitton
158bf5da77 Refine VC-Dir mass mark changes
* lisp/vc/vc-dir.el (vc-dir-mark-file): Prompt before unmarking
all subitems.  Use y-or-n-p and user-error instead of
yes-or-no-p and error.
(vc-dir-unmark-file): Use y-or-n-p instead of yes-or-no-p.
(vc-dir-allow-mass-mark-changes): Update docs.
2025-11-25 21:37:27 +00:00
Sean Whitton
304d4435b1 Make diff-revert-and-kill-hunk consider an active region
* lisp/vc/diff-mode.el (diff-revert-and-kill-hunk): When the
region is active, operate on all hunks it overlaps.
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document the change.
2025-11-25 21:07:04 +00:00
Sean Whitton
f5953186ef ; * lisp/emacs-lisp/pcase.el (pcase-setq): Fix parameter names. 2025-11-25 21:05:50 +00:00
Sean Whitton
39e9f96ba0 ; * lisp/emacs-lisp/cond-star.el: Tidy up dummy macro definitions. 2025-11-25 20:30:21 +00:00
Sean Whitton
449e15de5b ; * lisp/vc/diff-mode.el (diff-goto-source): Revise docstring again. 2025-11-25 15:53:15 +00:00
Sean Whitton
59e8b7267f Make diff-apply-hunk consider an active region
* lisp/vc/diff-mode.el (diff-apply-buffer): New 'no-save'
meaning for fourth optional argument.  Reserve other non-nil
values for this argument.  Use ngettext for one message.
(diff-apply-hunk): If the region is active, apply all hunks that
the region overlaps, like diff-apply-buffer.
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document the change to diff-apply-hunk.
2025-11-25 14:53:19 +00:00
Sean Whitton
1844ce4a0f * lisp/emacs-lisp/cond-star.el (pcase*): New dummy definition. 2025-11-25 14:22:58 +00:00
Sean Whitton
3f6c7d1bfb ; diff-mode-el: Improve docstrings re diff-jump-to-old-file. 2025-11-25 14:06:29 +00:00
Alan Mackenzie
9b505dd8d4 CC Mode: update Version: header. Add a comment about it
* lisp/progmodes/cc-defs.el (c-version): Add a comment
encouraging maintainers to keep cc-mode.el's Version: header
the same.

* lisp/progmodes/cc-mode.el (top level): Update the Version:
  header to 5.35.2.
2025-11-25 12:00:55 +00:00