Closed dpsutton closed 2 years ago
Can't people just turn-off eldoc-mode
locally? (e.g. using a hook)
I think you are right that this is not the way to go forward. A hook to turn off eldoc mode helps for newly created buffers but is annoying for any that already exist. But perhaps that's not so bad. Let me think on it for a bit. I'm wondering if other modes in the buffer use eldoc so that turning eldoc mode completely off is heavy handed.
I'm wondering if other modes in the buffer use eldoc so that turning eldoc mode completely off is heavy handed.
eglot
(LSP client) uses eldoc.
By the way, as an inspiration, eglot
has an variable for not interfering with other modes:
`eglot-stay-out-of: List of Emacs features that Eglot shouldn't automatically try to manage on users' behalf. Useful when you need non-LSP Flymake or Company backends. See docstring for examples.
I wonder if inf-clojure
could do the same for eldoc
.
I've updated it to be a bit more sensible i think. Now I just prohibit the eldoc setup when it is not enabled. This allows other modes to use eldoc and seems quite nice in practice for me.
I've added a couple of small feedback remarks. This also needs to be documented somewhere in the README.
All addressed I believe. Thanks for the thoughtful review @bbatsov !
You're welcome! Thanks for tackling this.
Eldoc is quite nice and puts the function signatures in the minibuffer. But it does this at a cost. Since inf-clojure only uses a single connection (currently at least) the commands interrupt the values of
*1
,*2
, etc. Further, this can lead to multiple prompts appearing in the repl buffer.user
appears multiple times, and then*1
has been bound to the result of getting arglistsThe multiple prompts is quite annoying when inserting forms into the repl.
Note that
*1
is oftentimesnil
because eldoc just runs(try (:arglists (meta _whatever-your-cursor-is-on)) (catch nil))
whenever your cursor stays on something for too long. This is also not throwing away too much functionality since you can easily get the docstring in the repl byC-c C-v
(inf-clojure-show-var-documentation
)