Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mode hook for eglot? #182

Closed
casouri opened this issue Dec 11, 2018 · 4 comments
Closed

Mode hook for eglot? #182

casouri opened this issue Dec 11, 2018 · 4 comments

Comments

@casouri
Copy link
Contributor

casouri commented Dec 11, 2018

Is there a hook like other major/minor mode hooks for eglot?

I looked into eglot-connect-hook but 1) it passes arguments into functions in hook, that's not good in some cases 2) Is it supposed to be used as a mode hook for eglot? I.e., get called when eglot is enabled. Or it has other purposes?

@casouri casouri changed the title hook for eglot? Mode hook for eglot? Dec 11, 2018
@joaotavora
Copy link
Owner

There is no explicit user-visible mode-hook for Eglot right now, because I haven't yet decided on what the desired semantics of that hook should be. There is, though, an internal eglot--managed-mode-hook call when eglot starts managing a file buffer and when when it stops managing a file buffer. I am not 100% convinced that it should be made public, but maybe you can help there if you explain what "other purposes" you see it used for.

@casouri
Copy link
Contributor Author

casouri commented Dec 11, 2018

I want the mode hook to enable eldoc-box-hover-mode. But I'm happy with eglot--managed-mode-hook. Maybe you can consider a public one when someone else asks for it for a good reason.

Or it has other purposes?

I mean if eglot-connect-hook has some special purpose so that it should not be used as a general mode hook (to enable stuff when eglot is enabled).

Feel free to close this. I have what I need now : P

@casouri casouri closed this as completed Jan 14, 2019
@joaotavora
Copy link
Owner

Let's not close this. I still haven'tmade eglot-managed-mode-hook public

@joaotavora joaotavora reopened this Jan 14, 2019
@nverno
Copy link

nverno commented Jan 27, 2019

Bump. I think it would be useful to disable/remove hooks for capf/eldoc/imenu/etc. that aren't configurable.

nemethf added a commit that referenced this issue Jan 13, 2020
Per #354, fix #182.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
Per joaotavora/eglot#354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Per joaotavora/eglot#354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Per #354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.

#182: joaotavora/eglot#182
#354: joaotavora/eglot#354
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
Per joaotavora/eglot#354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.

GitHub-reference: fix joaotavora/eglot#182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants