From c34e32e4b0551a5e261bae73d65438b5e0c58745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Wed, 12 Nov 2025 13:54:49 +0000 Subject: [PATCH] Eglot: clarify how to turn off semantic tokens * doc/misc/eglot.texi (Eglot Features, Eglot and Buffers): Tweak. --- doc/misc/eglot.texi | 14 +++++++++++++- etc/EGLOT-NEWS | 11 ++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 73dea276f15..3393f164138 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -508,7 +508,8 @@ capabilities to Emacs users. However, @xref{Extending Eglot}. Finally, it's worth noting that, by default, Eglot generally turns on all features that it @emph{can} turn on. It's possible to opt out of -some features via user options (@pxref{Customizing Eglot}) and a hook +features via the @code{eglot-ignored-server-capabilities} user option +(@pxref{Customizing Eglot}) and the @code{eglot-managed-mode-hook} hook that runs after Eglot starts managing a buffer (@pxref{Eglot and Buffers}). @@ -638,6 +639,17 @@ minor mode is turned on and when it's turned off; use the function or not. @end itemize +For example, to turn off @dfn{inlay hints} and @dfn{semantic tokens} by +default but still retain the ability to turn them on again +interactively use this: + +@lisp + (add-hook 'eglot-managed-mode-hook + (lambda () + (eglot-inlay-hints-mode -1) + (eglot-semantic-tokens-mode -1))) +@end lisp + @node Eglot Commands @section Eglot Commands @cindex commands, Eglot diff --git a/etc/EGLOT-NEWS b/etc/EGLOT-NEWS index 7de81c5686e..d9999248a31 100644 --- a/etc/EGLOT-NEWS +++ b/etc/EGLOT-NEWS @@ -23,13 +23,14 @@ https://github.com/joaotavora/eglot/issues/1234. ** Support for semantic tokens (bug#79374) The new minor mode 'eglot-semantic-tokens-mode' provides enhanced syntax -highlighting based on the language server's semantic analysis of the -code, going beyond traditional regular-expression-based fontification. -The 'eglot-semantic-faces' customization group contains options for +highlighting based on the language server's analysis, going beyond +traditional regular-expression-based fontification. The +'eglot-semantic-faces' customization group contains options for controlling which token types and modifiers to consider, as well as -faces for customizing their appearance. - +faces for customizing their appearance. The minor mode is on by +default: consult the manual on how to turn it off. + * Changes in Eglot 1.19 (23/10/2025) ** Support for call and type hierarchies