From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#70193: [PATCH] Re: bug#70193: Acknowledgement (eglot: RFE: recenter buffer upon showDocument request) Date: Wed, 17 Apr 2024 13:13:10 +0100 Message-ID: References: <1658f0ac-472f-4039-bf83-7abc31d77803@gmx.at> <878r1rgblr.fsf@betli.tmit.bme.hu> <4cdce8b3-66ea-4f16-b9ef-036466650eef@gmx.at> <867ch1r8g3.fsf@gnu.org> <8734rpmxup.fsf@betli.tmit.bme.hu> <87sezkcpua.fsf_-_@betli.tmit.bme.hu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="978"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Philip K." , martin rudalics , Eli Zaretskii , Alan Donovan , 70193@debbugs.gnu.org To: Felician Nemeth Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 17 14:14:03 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rx4Ar-000AbX-Bw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Apr 2024 14:14:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rx4Aj-0005Am-5Z; Wed, 17 Apr 2024 08:13:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rx4Ag-00059r-0H for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 08:13:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rx4Af-0007YW-Na for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 08:13:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rx4As-0001Ne-I0 for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Apr 2024 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70193 X-GNU-PR-Package: emacs Original-Received: via spool by 70193-submit@debbugs.gnu.org id=B70193.17133560255153 (code B ref 70193); Wed, 17 Apr 2024 12:14:02 +0000 Original-Received: (at 70193) by debbugs.gnu.org; 17 Apr 2024 12:13:45 +0000 Original-Received: from localhost ([127.0.0.1]:45969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rx4Aa-0001L1-PW for submit@debbugs.gnu.org; Wed, 17 Apr 2024 08:13:45 -0400 Original-Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:60723) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rx4AX-0001K9-5S for 70193@debbugs.gnu.org; Wed, 17 Apr 2024 08:13:43 -0400 Original-Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2d094bc2244so62951241fa.1 for <70193@debbugs.gnu.org>; Wed, 17 Apr 2024 05:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713356002; x=1713960802; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=U3jZA0AnnqfAvHjS92vE2eZ0pXyvs9LvhdNu0f/7cOo=; b=Ti+eAIjoBdrul1oDF1Dbz9pp3yK6i5ZCvabGr8dGz5GDaYT2HzDeZlu75PYJdX2nRm Xy0f95xniXPqs/7zpOT6pv3gWB5e5FqKgXQkmZMKhelQb3UQE2RrANB+j/t3zEgYwwvR nPNreOWv98+2gYm7bH3rJDBfYP/A+SpgGJ1VBOkzTZNYVOt0+HWe9zTINaPvh8n+XzXy gd/5fUtIWx/kYz+qtI92+OSMqxWPp0Zz5dHKLyH8x1NNuSLov+hOzW5YLfP4rWCqaWP1 e5d2Ujp7RnSxgDot1npgG+wsAyzvHMK8gSyMjyz1JWh1RtF/kC9HlPszmGOA2hFo2Kok q0DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713356002; x=1713960802; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U3jZA0AnnqfAvHjS92vE2eZ0pXyvs9LvhdNu0f/7cOo=; b=mmLUJSr1tOjM4Rse9f3zC4HTSkIbhrfem/HcZ11ZXis0I+ImdTXeOeELKRgVffZjZA VMiY32hzS4yIka5DUJJvsnLIkHT98G2t4quOb9QJMbryAOSOw/ZRRrQjIxKRMnMrcTGC FfuFTjK6z1yK0j6chD4FbP7a7Sa5HjtOIy4/Q2a7Fj5P2lS/oq3yv1i0sj6u8QaUdnBP rLJqyJsnXjCHRS129KN+ydzV+u0OzDICPy9qAxx5+6q3hDlUcqeIK6hVYeG5t8IQDUAn 8DM+UCWHOpk6IpvvNWKwSblSQjtGYygrLm0Y8gouMWA76D+mo8GSQbhdWSdNtoHUtbG0 dDEw== X-Forwarded-Encrypted: i=1; AJvYcCXfNy4gAB/RXQbMIId0eeo/WiTs4yMW1ItXt1Luw2PsIRtrH8UwiWmTeZwDkweLWbAgr8HRet/G3xpbP8fs4xi3s6bo/J4= X-Gm-Message-State: AOJu0YwXKCrdyvkeBys2AW9BU+fjUKPPfG4pAzhYrpG1p/8Tpv8G1N0h morPeGniDBsOFg3sklAp5cqvbVhP1qkkPkk2Q/xlx3Mzx/Hb9BhiRdKqK85hUR4NegKRU4Gk97Y Fp1x2XclemC3uzY9r84q6cDfxTpI= X-Google-Smtp-Source: AGHT+IHbEfD3exADwWg7Nbks6JWxuwI518lGX+2h9/OrP9loPjhCqZTaTErraDvx+bYhRI+UfvtYcYZYp6XDpfVXkBE= X-Received: by 2002:a2e:9e82:0:b0:2d8:a82f:50a0 with SMTP id f2-20020a2e9e82000000b002d8a82f50a0mr9765952ljk.35.1713356001956; Wed, 17 Apr 2024 05:13:21 -0700 (PDT) In-Reply-To: <87sezkcpua.fsf_-_@betli.tmit.bme.hu> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283483 Archived-At: On Wed, Apr 17, 2024 at 10:15=E2=80=AFAM Felician Nemeth wrote: > > Hi Jo=C3=A3o, > > 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 packag= e (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=C3=A1n :-) If this is another baby step towards you becoming Eglot maintainer, I'm happy :-) Jo=C3=A3o Jo=C3=A3o