[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Eglot activation
From: |
Arash Esbati |
Subject: |
Re: Eglot activation |
Date: |
Thu, 15 Feb 2024 14:32:03 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Keita,
Ikumi Keita <ikumi@ikumi.que.jp> writes:
> I think I have figured out the reason. The culprit is the insufficient
> capability of pseudo-parent mode facility I discussed in bug#69069[1].
> Eglot finds out the correct server if we extend
> `provided-mode-derived-p' so that several our new modes identify
> themselves as descended from `tex-mode' as the attached patch.
Thanks for digging into this. Your patch LGTM, do you want to install
it?
> ;; COMPATIBILITY for Emacs<30
> (unless (fboundp 'derived-mode-add-parents)
I'm not sure but I think you can add
(declare-function TeX--compat-provided-mode-derived-p "tex")
here if you want to silence the compiler; `declare-function' doesn't
need to be top-level, IIRC.
> - (advice-add 'derived-mode-p :after-until
> + (advice-add 'provided-mode-derived-p :after-until
> ;; Don't quote by #'-style to avoid compiler warning.
> - 'TeX--compat-derived-mode-p)
> - (defun TeX--compat-derived-mode-p (&rest modes)
> - "Add pseudo-parents facility to `derived-mode-p' like Emacs 30.
> -Modes registered in `derived-mode-extra-parents' property of the
> -current major mode name symbol are regarded as parent modes as
> -long as `derived-mode-p' is concerned."
> - (let ((extra-parents (get major-mode 'derived-mode-extra-parents)))
> - (and extra-parents
> - (cl-loop for parent in extra-parents
> - thereis (memq parent modes))))))
> + 'TeX--compat-provided-mode-derived-p)
> + (defun TeX--compat-provided-mode-derived-p (mode &rest modes)
> + "Add pseudo-parents facility to `provided-mode-derived-p' like Emacs 30.
> +Modes registered in `derived-mode-extra-parents' property of MODE
> +symbol are regarded as parent modes by `provided-mode-derived-p'."
> + (when (rassq mode TeX-mode-comparison-alist)
> + (let ((extra-parents (get mode 'derived-mode-extra-parents)))
> + (and extra-parents
> + (cl-loop for parent in extra-parents
> + thereis (memq parent modes)))))))
Best, Arash