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

180368 commits

Author SHA1 Message Date
Jackson Ray Hamilton
9b3eb06c76
Indent jsx_text properly with modern grammars
* lisp/progmodes/js.el:
* lisp/progmodes/typescript-ts-mode.el: Indent jsx_text from correct
column when a modern grammar is installed; previously was over-indented.
2025-11-14 22:32:15 -08:00
João Távora
f772fe526a Eglot: fix bug in eglot--semtok-font-lock
The entry condition to eglot--semtok-font-lock-1, which checks
if the region to refontify is contained in the recorded region
in eglot--semtok-cache was blatantly wrong.  It used 'beg'
twice!

* lisp/progmodes/eglot.el (eglot--semtok-font-lock): Fix bug.
2025-11-14 22:29:34 +00:00
João Távora
f83c35788a Eglot: invalidate local semtok cache at server's bidding
When the server sends workspace/semanticTokens/refresh, calling
font-lock-flush isn't enough.  It will trigger a new
eglot--semtok-font-lock call, but we can't assume anything about
the validity of eglot--semtok-cache.

Clangd seems to send workspace/semanticTokens/refresh when
complicated enough changes happen in an LSP document.  If the
buffer-local eglot--semtok-cache isn't flushed we'll likely
request a delta, and clangd may still supply it, but it won't
apply correctly to the outdated local state.

* lisp/progmodes/eglot.el (eglot--semtok-cache)
(eglot--semtok-inflight): Move up here.
(eglot-handle-request): Flush the eglot--semtok-cache.
2025-11-14 15:45:37 +00:00
João Távora
d81bb68ed0 Eglot: janitorial cleanup
* lisp/progmodes/eglot.el (eglot--lsp-position-to-point): Use
eglot--widening.
(eglot--lsp-position-to-point): Use eglot--widening.
(eglot-range-region): New util.
(eglot-format)
(eglot--code-action-params)
(eglot--update-hints-1)
(eglot--semtok-request): Use eglot-range-region.
(eglot--after-change): Add comment.

eglot-range-region is an idea by Lua Viana Reis <me@lua.blog.br>
2025-11-14 15:45:37 +00:00
Sean Whitton
78a73acf61 ; * lisp/emacs-lisp/cond-star.el (cond*): New FIXME. 2025-11-14 14:12:38 +00:00
Sean Whitton
3c9bcdebe4 Autoload match*, bind*, bind-and* dummy macros
* lisp/emacs-lisp/cond-star.el (match*, bind*, bind-and*):
Autoload, for the sake of syntax highlighting.
2025-11-14 14:11:04 +00:00
Sean Whitton
0d4741ec92 diff-apply-hunk: Don't display BUF in the selected window
* lisp/vc/diff-mode.el (diff-apply-hunk): Don't display BUF in
the selected window.
2025-11-14 13:00:13 +00:00
Eli Zaretskii
a40d8885f8 ; * lisp/progmodes/hideshow.el: Fix wording in commentary. 2025-11-14 10:14:14 +02:00
Spencer Baugh
ab8d3624c4 Do eager display of *Completions* while idle
Don't block user input while rendering the *Completions* buffer
due to eager-display.  This allows eager-display to be used with
larger and slower completion tables without interfering with the
user.  Like in eager-update, we use while-no-input and
non-essential to ensure that eager-display happens without
blocking the user.

To support this, we remove the ability to set eager-display to a
function.  The only user was tmm.el, which nows sets
eager-display to t and adds a completion-setup-hook instead.
(This also fixes a bug in tmm where dismissing and redisplaying
the *Completions* buffer would not have the special help text)

* lisp/minibuffer.el (completion-eager-display--timer)
(completions--eager-display, completions--start-eager-display):
Add. (bug#79819)
(completing-read-default): Call
completions--start-eager-display, stop supporting functionp
eager-display.
* lisp/tmm.el (tmm-add-prompt): Delete.
(tmm--completion-setup-hook): Add.
(tmm-add-prompt): Add completion-setup-hook, set eager-display
to t.
(tmm-goto-completions): Call minibuffer-completion-help instead
of tmm-add-prompt.
2025-11-14 09:29:30 +02:00
Elías Gabriel Pérez
4e08b2d434 ; hideshow: Fix previous changes
* lisp/progmodes/hideshow.el (hs--add-indicators): Add the
indicators per line (bug#79810).
(hs-already-hidden-p, hs-hide-block): Simplify.
2025-11-14 09:23:35 +02:00
Elías Gabriel Pérez
99ec59f1a4 hideshow: Update Header Commentary. (Bug#79829)
* lisp/progmodes/hideshow.el: Document how to migrate from
'hs-special-modes-alist'.
2025-11-14 09:20:01 +02:00
João Távora
7a3b8c6df5 Eglot: add two semtok tests
The tests are pretty basic, I don't expect them to catch
anything else than giant bugs.

* test/lisp/progmodes/eglot-tests.el (eglot-test-semtok-basic)
(eglot-test-semtok-refontify): New tests.
(eglot--semtok-faces, eglot--semtok-wait): New helpers.
2025-11-13 22:18:46 +00:00
João Távora
6126ab8d82 Eglot: tweak some semtok functions to be more debug-friendly
* lisp/progmodes/eglot.el (eglot--semtok-request): Return value
records return reason.
(eglot--semtok-font-lock-1): Return number of painted tokens and
exit locus.
(eglot--semtok-decode-token): Rename
from eglot--semtok-token-faces.  Rework.
(eglot--semtok-font-lock-1): Use eglot--semtok-decode-token.
2025-11-13 22:18:46 +00:00
João Távora
2f196548f5 Eglot: tidy overlay cleanup code
And turn off semtok when tearing down eglot--managed-mode.

* lisp/progmodes/eglot.el (eglot--delete-overlays): New helper.
(eglot--managed-mode): Turn off minor modes and cleanup here.
(eglot--managed-mode-off): Not here.
(eglot-highlight-eldoc-function)
(eglot-code-action-suggestion): Use eglot--overlay prop.
(eglot-inlay-hints-mode): Use eglot--delete-overlays.
2025-11-13 22:18:46 +00:00
Elías Gabriel Pérez
394090486c hideshow: Fix indicator mouse clicks on TTY
* lisp/progmodes/hideshow.el (hs-make-overlay)
(hs--make-indicators-overlays): Rework (bug#79585).
2025-11-13 20:30:36 +02:00
Sean Whitton
4a8b7bd217 ; * lisp/vc/vc.el (vc-revert-revision): Fix line length. 2025-11-13 18:13:58 +00:00
Sean Whitton
5e819f76dc read_key_sequence: Additional check for fix_current_buffer
* src/keyboard.c (read_key_sequence): If we were interrupted
while initializing the terminal, also check for a change of
current buffer (bug#79513).
2025-11-13 17:17:34 +00:00
Sean Whitton
8e5c4c411d New dummy defmacro for bind*
* lisp/emacs-lisp/cond-star.el (bind*): New macro, like match*
and bind-and*.
2025-11-13 17:15:18 +00:00
Sean Whitton
6b7512ed61 ; * lisp/vc/vc-dispatcher.el (vc-do-async-command): Limit precision. 2025-11-13 17:09:49 +00:00
Sean Whitton
2e8cc345d5 VC revert commands: Facilities to entirely delete revisions
* lisp/vc/vc.el (vc-revision-revert, vc-revision-cherry-pick):
Rename to ...
(vc-revert-or-delete-revision, vc-cherry-pick):
... these (bug#79408).  All uses changed.
* lisp/vc/log-view.el (log-view-revision-revert)
(log-view-revision-cherry-pick): Rename to ...
(log-view-revert-or-delete-revisions, log-view-cherry-pick):
... these.  All uses changed.
* lisp/vc/log-view.el (log-view-revert-or-delete-revisions):
* lisp/vc/vc.el (vc-revert-or-delete-revision): New INTERACTIVE
and DELETE parameters, and prefix argument.  Offer to entirely
delete REV in certain circumstances (bug#79408).
* lisp/vc/log-view.el (log-view--pick-or-revert):
* lisp/vc/vc.el (vc--pick-or-revert): New INTERACTIVE and DELETE
parameters.  All uses changes.
* lisp/vc/log-view.el (log-view-revert-revisions)
(log-view-delete-revisions):
* lisp/vc/vc.el (vc-revert-revision, vc-delete-revision): New
commands (bug#79408).
* doc/emacs/maintaining.texi (VC Change Log, VC Undo)
(Copying Between Branches):
* etc/NEWS: Document the changes.
2025-11-13 17:07:20 +00:00
Sean Whitton
5dfcba699e Revised bindings for diff-revert-and-kill-hunk
* lisp/vc/diff-mode.el (diff-mode-shared-map): Bind
diff-revert-and-kill-hunk to 'u'.
(diff-mode-map): Replace binding for diff-revert-and-kill-hunk
with 'C-c M-u'.
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document the change.
2025-11-13 16:22:20 +00:00
Robert Pluim
a0c69d3d44 Support unqualified keycap emoji
* admin/unidata/emoji-zwj.awk: Add U+20E3 as a trigger codepoint
so that U+0023 U+20E3 and similar are displayed using the emoji
font.
2025-11-13 16:06:28 +01:00
Stefan Monnier
ff2383a00f * lisp/replace.el (replace--push-stack, perform-replace): Use markers
Don't use integers to store match data for "long term".
Otherwise, buffer edits that occur between two steps
(e.g. via process filters of post-command-hooks) makes it invalid,
leading to very confusing behavior, e.g. after `C-M-% ... y`
the right (next) match is highlighted yet if a process-filter or
post-command-hook runs, the next `y` may replace something else
than what was highlighted.
2025-11-13 09:17:03 -05:00
Stefan Monnier
5d9eab261f etc/NEWS.28: Mention read-symbol-shorthands to improve C-h v info 2025-11-13 09:06:37 -05:00
Stefan Monnier
05ea637d60 lisp/emacs-lisp/bytecomp.el (define-widget): Add funarg-positions 2025-11-13 09:01:36 -05:00
Stefan Monnier
580d74e1e1 (loaddefs-generate--emacs-batch): Fix bug#79821
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch):
Expand file names before changing directory, in case they're relative.
2025-11-13 08:23:55 -05:00
João Távora
5ccd4d7406 ; Eglot: tweak manual's wording of "language server"
* doc/misc/eglot.texi (Eglot Features)
(Eglot and Buffers)
(Eglot Commands): "language-server" -> "language server"
2025-11-12 21:29:57 +00:00
João Távora
6b2a7b8479 Eglot: document semantic tokens (semtok) feature (bug#79374)
Also clarify how to turn off semantic tokens and inlay hints, since I
suspect that will be a theme.

* doc/misc/eglot.texi (Eglot Features): Add semantic tokens.  (Eglot
Commands): Document eglot-semantic-tokens-mode.  (Eglot and Buffers):
Provide example on how to turn off semtok and inlay hints.

* etc/EGLOT-NEWS (Changes to upcoming Eglot): Announce semantic
tokens support
2025-11-12 21:26:02 +00:00
João Távora
f466c0c43d Eglot: don't use eglot--semtok-idle-timer (bug#79374)
Don't have evidence for the usefulness of this technique yet.

* lisp/progmodes/eglot.el (eglot--semtok-idle-timer): Delete.
(eglot--semtok-request): Simplify.
2025-11-12 21:26:02 +00:00
João Távora
6337ff8214 Eglot: rework semtok defcustoms and face calculation (bug#79374)
* lisp/progmodes/eglot.el (eglot-semantic-tokens-faces)
(eglot-semantic-tokens-modifier-faces): Delete.
(eglot--semtok-types, eglot--semtok-modifiers): Rename from
eglot-semantic-tokens-faces and
eglot-semantic-tokens-modifier-faces.
(eglot-client-capabilities): Tweak.
(eglot--lsp-interface-alist): Add SemanticTokensLegend.
(eglot--connect): Don't initialize a server.
(eglot--semtok-define-things): New helper.
(eglot-lsp-server): Just one slot needed.
(eglot--semtok-token-faces): Rework.
2025-11-12 21:26:02 +00:00
João Távora
583493cb21 Eglot: debounce consecutive semtok full/delta requests (bug#79374)
Many back-to-back calls for 'eglot--semtok-request' and small
regions occur even on trivial fast edits.  Even though it's
cheap and harmless to send many delta rquests, it's nicer to
just send just one.

The debouncing from jsonrpc-async-request isn't enough.  When a response
to a semtok request is received, it's important to remember which
regions to flush.  Font-lock logic will then do its magic and coalesce
those regions into one before invoking eglot--semtok-font-lock, and
eglot--semtok-font-lock-1 will have up-to-date data to work with.

* lisp/progmodes/eglot.el (eglot--semtok-inflight): New variable.
(eglot--semtok-request): Use it.
2025-11-12 21:26:02 +00:00
João Távora
2d153ab44a Eglot: rework semtok again to use only font-lock (bug#79374)
Stefan's idea to use ONLY font-lock instead of jit-lock seems more
promising and less buggy.  I did have to add this slightly odd
eglot--semtok-font-lock-2 kludge.  Other than that, it seems fine.

* lisp/progmodes/eglot.el (eglot-semantic-tokens-mode): Now use
ONLY font-lock.
(eglot--semtok-request): Rework, don't call painting function
here.
(eglot--semtok-font-lock): Rename from eglot--semtok-jit-lock and
use a single arg.  Maybe call eglot--semtok-font-lock-2.  Return
nil or risk crashing Emacs.
(eglot--semtok-font-lock-1): Rework slightly.
(eglot--semtok-font-lock-2): New helper.
(eglot-region-range): Delete.
2025-11-12 21:26:02 +00:00
João Távora
7ead81da1d Eglot: rework semtok to use only jit-lock (bug#79374)
Kept the general structure but clarified the code paths.

Simplify many things.  Instead of font-lock-add-keywords, use
jit-lock-register exclusively.  Works, but slightly problematic,
since when editing the buffer the existing enriched face
information is first removed, then re-added.  Will try other
approaches.

* lisp/progmodes/eglot.el (eglot-lsp-server): Tweak doc.
(eglot--semtok-request-full-on-idle): Delete.  Integrated into caller.
(eglot--semtok-jit-lock): Rename from eglot--semtok-propertize.  Rework.
(eglot--semtok-jit-lock-1): Extract from old eglot--semtok-propertize.
(eglot-semantic-tokens-mode): Use new eglot--semtok-jit-lock name.
(eglot--semtok-put-cache)
(eglot--semtok-ingest-range-response)
(eglot--semtok-ingest-delta-response)
(eglot--semtok-ingest-full-response): Delete helpers.
(eglot--semtok-apply-delta-edits): Rework with more cl-loopy idioms.
(eglot--semtok-flush-region): Delete.
(eglot--semtok-request): Now takes a region as argument.  Rework extensively.
(eglot-connect-hook): Don't put
eglot--semtok-initialize here.
(eglot--connect): Rather here.
(eglot--semtok-token-faces): New helper.
(eglot--semtok-font-lock): Delete.
(eglot--semtok-initialize): Rework.
(eglot-semantic-tokens-mode): Simplify.
2025-11-12 21:26:02 +00:00
João Távora
c65a556829 Eglot: fix bug on server-intiated semtok refresh (bug#79374)
src/emacs -Q src/cm.c \
   --eval '(trace-function (quote eglot--semtok-propertize))' \
   --eval '(trace-function (quote eglot--semtok-request))' \
   --eval '(trace-function (quote font-lock-flush))' -f eglot

More trace-values will show that too many full requests are being
sent.

* lisp/progmodes/eglot.el
(eglot-handle-request): Don't bump eglot--versioned-identifier,
since that confuses semtok bootstrap in a new file with clangd.
2025-11-12 21:26:01 +00:00
João Távora
cfd77501d7 Eglot: rework semtok code (bug#79374)
* lisp/progmodes/eglot.el (eglot-semantic-tokens-faces)
(eglot-semantic-tokens-modifier-faces): Move up to defcustom section.
(eglot--semtok-request-full-on-idle, eglot-handle-request)
(eglot--semtok-build-face-map, eglot--semtok-initialize)
(eglot-semantic-tokens-mode): Move into semantic tokens section.
(eglot--semtok-font-lock): Rename from
eglot--semtok-fontify-tokens.
(eglot-semantic-tokens-mode): Use eglot--semtok-font-lock.
(eglot--semtok-ingest-delta-response): Rename from
eglot--semtok-ingest-full/delta-response
(eglot--semtok-request): Use new function.
2025-11-12 21:26:01 +00:00
Lua Viana Reis
51d0b3ef98 Eglot: add semantic token (semtok) support (bug#79374)
* lisp/progmodes/eglot.el (eglot-semantic-tokens-faces)
(eglot-semantic-tokens-modifier-faces): New defcustom..
(eglot-ignored-server-capabilities): Tweak.
(eglot-client-capabilities): Advertise semtok support.
(eglot-lsp-server): Tweak.
(eglot-region-range): New helper.
(eglot-connect-hook): Add eglot--semtok-initialize.
(eglot--maybe-activate-editing-mode): Activate
eglot-semantic-tokens-mode.
(eglot--semtok-idle-timer, eglot--semtok-cache)
(eglot--semtok-put-cache, eglot--semtok-ingest-range-response)
(eglot--semtok-ingest-full-response)
(eglot--semtok-apply-delta-edits)
(eglot--semtok-ingest-full/delta-response)
(eglot--semtok-flush-region, eglot--semtok-request)
(eglot--semtok-propertize, eglot--semtok-fontify-tokens)
(eglot--semtok-request-full-on-idle): New helpers.
(eglot-handle-request workspace/semanticTokens/refresh): New
request handler.
(eglot--semtok-build-face-map, eglot--semtok-initialize): New
helpers.
(eglot-semantic-tokens-mode): New minor mode.
(desktop): Mention eglot-semantic-tokens-mode.
(command-modes tweak): Add eglot-semantic-tokens-mode.

Co-authored-by: João Távora <joaotavora@gmail.com>
2025-11-12 21:25:38 +00:00
Sean Whitton
f9c94e05f5 vc-do-async-command: Print how long command took to run
* lisp/vc/vc-dispatcher.el (vc-do-async-command): Print how long
the command took to run.
2025-11-12 15:00:00 +00:00
Sean Whitton
e7696c64a9 ; * lisp/vc/vc-dispatcher.el (vc-do-command): Improve docstring. 2025-11-12 14:21:15 +00:00
Sean Whitton
1484e3108a vc-do-command: Restore using a pipe in the async case
* lisp/vc/vc-dispatcher.el (vc-do-command): Restore using a pipe
in the async case.  This was unintentionally changed when adding
support for discarding output.
2025-11-12 13:08:17 +00:00
Marc Herbert
288f1bc7d9 ; gnus-summary-line-format: Fix '%&user-date;' docs (bug#79820). 2025-11-12 12:19:33 +00:00
Sean Whitton
1c87be8ac9 ; * lisp/gnus/gnus.el (gnus-summary-line-format): Reindent. 2025-11-12 12:19:33 +00:00
Eli Zaretskii
6969b53028 ; * lisp/progmodes/hideshow.el (hs-hideable-region-p): Doc fix. 2025-11-11 21:36:33 +02:00
Po Lu
45a82437a3 Merge from savannah/emacs-30
ca4af1768d Fix crash on Android 2.2
2025-11-12 01:14:37 +08:00
Po Lu
ca4af1768d Fix crash on Android 2.2
* src/android-asset.h (AAssetManager_open): Initialize desc and
asset to NULL, lest `desc' be accessed uninitialized if C_NAME
does not exist in the directory tree.
2025-11-12 01:13:46 +08:00
Michael Albinus
b398a6c629 Extend Tramp direct async processes for further methods
* lisp/net/tramp-container.el (tramp-methods) <distrobox>:
* lisp/net/tramp-sh.el (tramp-methods) <sg>: Add `tramp-direct-async'.
(tramp-expand-script): Fix typo in script name.
(tramp-maybe-send-script): Adapt docstring.
2025-11-11 16:40:33 +01:00
Sean Whitton
4bb1b938df ; * lisp/progmodes/hideshow.el (hs-minor-mode): Style fixes. 2025-11-11 12:47:31 +00:00
Sean Whitton
3d844e49f7 ; * lisp/vc/vc-hooks.el: Note vc-after-revert in after-revert-hook. 2025-11-11 12:45:16 +00:00
Sean Whitton
fd16fcce52 ; minibuffer-default-add-shell-commands: Use 'and' not 'unless'. 2025-11-11 12:38:38 +00:00
Elías Gabriel Pérez
48ef7d91b1 hideshow: Fix indicators for multiple block in the same line
bug#79810

* lisp/progmodes/hideshow.el (hs-hideable-region-p): Simplify.
(hs-block-positions): Change return value.
(hs--add-indicators): Go to the next line only if we have
successfully created the overlays.
(hs-hide-block-at-point, hs-hide-block): Update code.
2025-11-11 09:38:49 +02:00
Juri Linkov
9709cb8d16 Improve hideshow support for heex-ts-mode and yaml-ts-mode
* lisp/progmodes/heex-ts-mode.el (heex-ts--thing-settings): Add 'defun' thing.
(heex-ts-mode): Use it in 'hs-treesit-things'.

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode): Set 'hs-treesit-things'
and 'hs-adjust-block-end-function'.
2025-11-10 21:46:29 +02:00