all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Felician Nemeth <felician.nemeth@gmail.com>
Cc: "Philip K." <philipk@posteo.net>,
	martin rudalics <rudalics@gmx.at>, Eli Zaretskii <eliz@gnu.org>,
	Alan Donovan <adonovan@google.com>,
	70193@debbugs.gnu.org
Subject: bug#70193: [PATCH] Re: bug#70193: Acknowledgement (eglot: RFE: recenter buffer upon showDocument request)
Date: Wed, 17 Apr 2024 13:13:10 +0100	[thread overview]
Message-ID: <CALDnm53m-Wf_wQTDYF00zRiM27yqmfQR7TNeLcQpSnwPxPF89A@mail.gmail.com> (raw)
In-Reply-To: <87sezkcpua.fsf_-_@betli.tmit.bme.hu>

On Wed, Apr 17, 2024 at 10:15 AM Felician Nemeth
<felician.nemeth@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





  reply	other threads:[~2024-04-17 12:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 13:17 bug#70193: eglot: RFE: recenter buffer upon showDocument request Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.70193.B.171223666917509.ack@debbugs.gnu.org>
2024-04-04 13:32   ` bug#70193: Acknowledgement (eglot: RFE: recenter buffer upon showDocument request) Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-04 14:43     ` Felician Nemeth
2024-04-05  9:07     ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-05 13:53       ` Felician Nemeth
2024-04-07  7:30         ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-13  8:08           ` Eli Zaretskii
2024-04-13  9:10             ` Felician Nemeth
2024-04-13 16:36               ` Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-17  9:15                 ` bug#70193: [PATCH] " Felician Nemeth
2024-04-17 12:13                   ` João Távora [this message]
2024-04-23  7:43                     ` Felician Nemeth
2024-04-23  9:27                       ` João Távora
2024-04-24 16:37                         ` Juri Linkov
2024-04-24 20:14                           ` João Távora
2024-04-27 10:25                     ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALDnm53m-Wf_wQTDYF00zRiM27yqmfQR7TNeLcQpSnwPxPF89A@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=70193@debbugs.gnu.org \
    --cc=adonovan@google.com \
    --cc=eliz@gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=philipk@posteo.net \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.