Subject: bug#67609: 29.1; (eglot-inlay-hints-mode -1) behaves surprisingly, does not work in cc-mode hooks

From: João Távora <[email-masked]>
Date: Sun, 3 Dec 2023 19:23:19 +0000

On Sun, Dec 3, 2023 at 7:02 PM Morgon Kanter <[email-masked]> wrote:

> (defun config:cc-defaults ()
>   ;(setq c-require-final-newline t)  ;; lol causes errors in cc-mode
>   (c-toggle-comment-style 1)
>   (subword-mode 1)
>   (diminish 'subword-mode)
>   (local-set-key (kbd "C-M-S-<backspace>") #'kill-outer-sexp-and-parens)
>   (eglot-inlay-hints-mode -1))
>
> ...and I will receive the same behavior. The eglot-ensure here is a red herring.

I never said this would work either.  It's not a red herring
in the sense that you shouldn't expect eglot-ensure to have
loaded eglot in the buffer after the form has finished.

And you shouldn't expect (eglot-inlay-hints-mode -1) to have
any effect before Eglot is loaded, which obviously does not
happen in the absence of any Eglot-related command as you show here.

So, this doesn't add anything to the story.

> To reproduce, visit a C++ buffer in a project, run M-x eglot. Inlay
> hints will appear. Kill and reopen the buffer. Inlay hints will
> appear.

To achieve your desired behaviour, read my advice in the last email,
thanks.

João