GNU bug report logs -
#70193
eglot: RFE: recenter buffer upon showDocument request
Previous Next
Full log
View this message in rfc822 format
On Wed, Apr 17, 2024 at 10:15 AM Felician Nemeth
<felician.nemeth <at> gmail.com> wrote:
>
> Hi João,
>
> I've attached a patch fixing this issue. It includes Martin's new
> recenter-region.
Thanks. I'm sure the patch is correct but 50+ lines of
window-management code in eglot.el? Just for that one user?
There's nothing LSP-specific in the new function
`eglot--window-recenter-region`, it's pure window management code.
The derived-mode-p specifically bit also looks very much out
of place in Eglot. What is it accomplishing, and why is this
prog-mode exception not in the preceding function itself
(maybe as an optional toggle)
In fact, there's nothing intrinsically LSP-specific about having
clients request Emacs shows the user a given part of a file.
I can't believe this obscure LSP interface is its only client.
Is it really?
So, if this new impeccably documented function designed by Emacs's
window management expert :-) does what it says, I think we should
put it somewhere else.
In fact, I think I've independently implemented parts of it in my
SLY and Zapp extensions at some point in time, where they also don't
belong so it would definitely be useful.
Practical matters: there's the usual problem with Eglot
compatibility with older Emacsen, but there's:
* compat.el (I think Phil has already made Eglot use compat.el recently)
* there's the strategy of using (or creating) another GNU ELPA :core package
(like external-completion.el and many other ones)
* there' the strategy of 'fboundp' where this nice-to-have "excellent
recentering" feature would only appear to Eglot users running it on
a recent Emacs.
I think all of these are preferable to bloating Eglot's code by this much
motivated by this minuscule use case.
All that said: I'll let you make the call Felicián :-) If this is
another baby step towards you becoming Eglot maintainer, I'm happy :-)
João
João
This bug report was last modified 1 year and 109 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.