From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felician Nemeth Newsgroups: gmane.emacs.bugs Subject: bug#70193: [PATCH] Re: bug#70193: Acknowledgement (eglot: RFE: recenter buffer upon showDocument request) Date: Tue, 23 Apr 2024 09:43:47 +0200 Message-ID: <877cgobk24.fsf@betli.tmit.bme.hu> 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="12932"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: "Philip K." , martin rudalics , Eli Zaretskii , Alan Donovan , 70193@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 23 09:44:58 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 1rzApm-0003DO-Ld for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Apr 2024 09:44:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzApb-0003nF-5A; Tue, 23 Apr 2024 03:44:47 -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 1rzApZ-0003n1-Rc for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 03:44:45 -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 1rzApZ-0007Qe-JO for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 03:44:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rzApp-0005zM-Um for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 03:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Felician Nemeth Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Apr 2024 07:45:01 +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.171385825822829 (code B ref 70193); Tue, 23 Apr 2024 07:45:01 +0000 Original-Received: (at 70193) by debbugs.gnu.org; 23 Apr 2024 07:44:18 +0000 Original-Received: from localhost ([127.0.0.1]:50568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzAp7-0005vx-C5 for submit@debbugs.gnu.org; Tue, 23 Apr 2024 03:44:18 -0400 Original-Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:53623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzAp1-0005uv-Lc for 70193@debbugs.gnu.org; Tue, 23 Apr 2024 03:44:16 -0400 Original-Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-518a3e0d2ecso7965922e87.3 for <70193@debbugs.gnu.org>; Tue, 23 Apr 2024 00:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713858229; x=1714463029; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:face:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=uezFjA3NPuqaBgkMzHyXoNEbTa8jgIP4kqGN4nh7o+A=; b=V3/KHFOPx448d+1/UurwrhKEOUumHjTBMHwC7zBBIVJHvVKA+vQ1lleTAc9T//OW29 7Q53j7zuxKNUTRMq7TZ4+2n1hj9etP9W8sX0DZwPDZedUoYsQYz87hM8dEQz74IEUj4d rHucJ0KthzoXbdCXGuDg1Tg6sKDfLZ0Z5vhGRpAqqKvUvzocQKB7z5QuayfZMyzQ8B/T 2xklaaIQRuGuwQfXJHYvs1OSh/vttDzsToNw+pHGQygT6GJc7d7TPebz1Bw7eSj3tXwU AgNbhHKcrJyvBxdk51j3f472X+UQw0m2ZikU+IYKnKSqhDA5KDH5kuNWkvV7upnjalzh MJXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713858229; x=1714463029; h=content-transfer-encoding:mime-version:face:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uezFjA3NPuqaBgkMzHyXoNEbTa8jgIP4kqGN4nh7o+A=; b=dB3yyG18rKb3M9lh+k3hMXFxeYdGu7eioSMzWKaODyk0virmzo/ZIDS9RsVybDuULr xQkyhQJuN/j2i5b6hwayLW1Jo3ye16CxV9XjzUcqUqM+jDCIFOH7aEPcVaXrcA5bqjID U2DAvWI2tNXylkFhTswjdqQ5lPILOSkx56bE8Q5fKo4XwyhEzAUmrKJ3Jto0hn0IpJB7 yUQJh6ixdHifINGKI32uZRi7nO57bYMM5po5vMiMTM0fetzXXzxC//UIjyD4Sv67QCUi RneZMaYej80FF5KLFhzQVF0SWimssRlomhC5rB4T1K+0H68PNX/NT8nrUBwXV5LEGlT6 w6rw== X-Forwarded-Encrypted: i=1; AJvYcCUPfLC5uXz5zKROe+ME4+J6LTsVjKqXlPdjZwAOy2Ojlxqu99wMuMveIY4IN7lX3RnSnhoLTbKaKwUXyyDxU8jpuq8Mq5U= X-Gm-Message-State: AOJu0YwwxxPjNN2jYEUKL3IG6OVvSfJWRCis3DoaLNilDZkLzjwZBld6 DArAYYgURugrTgIxJ6CyBifjc0M6mbQPN7k7A9cbBtemLij/8YQI X-Google-Smtp-Source: AGHT+IHMKTYqRHDf0V/63S6D0F1iwtONMGVw+M2DQobZaAMKQZKrHHtENCHc4o93AMqLt0opfkK1zg== X-Received: by 2002:a05:6512:483:b0:518:e7ed:3c7c with SMTP id v3-20020a056512048300b00518e7ed3c7cmr9726604lfq.14.1713858228949; Tue, 23 Apr 2024 00:43:48 -0700 (PDT) Original-Received: from betli.gmail.com (catv-213-222-160-137.catv.fixed.vodafone.hu. [213.222.160.137]) by smtp.gmail.com with ESMTPSA id d17-20020a1709063ed100b00a52222f2b21sm6682308ejj.66.2024.04.23.00.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 00:43:48 -0700 (PDT) In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Wed, 17 Apr 2024 13:13:10 +0100") Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUMBwgHAgMFAAGPjY7/ //80MDHq6eqJt3pKAAABr0lEQVQ4jX2UzZKDIAzHqR177q7TPbtx2HMr6guQcrbY9txZ0fd/hA0f onXazcEJ/CD8E4Js8/HS9mwjXtqeMRxHXJkakTEm4b4GPVQW8PU8ov4fQCqeThlF60MBWdo1IXzd 2nEEZE7CEAZLwI0N/gJAhTj7ESQAX4gPgO8lyI+cvgViSVPlNomAj2M9gW40eg7VWY3cATjUcyiO Z+i03cFruGLYoUR7VyU3HihdmCEVhoDN65FXkpbSxkomOzsTQN/gySaodGb9Gdi1oSRXP46gdBWh LcUKJNdeGCWac74GKakmne0aHCFvyqJPYLsCFAVlhRTvGdzMdLHqtgRyUulyXIAH7CYQ3AB0Nody JQhAkq/qtOnbjhxdzYDkXPxlH5y4WdUAeUcX1NVJ6GR7UQEYPGWoAnA36OQNn5lRRp38vHTAp9Br LoTmvlPPDoRCKzpjG1SXT89AaT5l456BamJuMcs+NIOMzJ/s5dI6yUVcrARlruwOebfdv6gunTn4 ww3+QjGBEn5suVyLHoSGvAqREuDLN+iqZ+VcFg+HBbsJUU9+FZthbez9T+bdb+kPv2Ls6ct3hTkA AAAASUVORK5CYII= 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:283873 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > I'm sure the patch is correct but 50+ lines of window-management code > in eglot.el?=20 I agree it can go elsewhere. > Just for that one user? I don't think that should matter. > 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) reposition-window relies on `beginning-of-defun' and `end-of-defun', but it is potentially better than window-recenter-region, because if the selection of showDocument is inside a function, then it tries to show the preceding comments as well. > 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? Maybe textDocument/publishDiagnostics is somewhat similar. Flymake shows the region of the diagnostic messages with as little care as Eglot currently shows the selection of showDocument. > 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. I agree. > 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 pack= age > (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 the third option is good enough in this case. The current patch can be regarded as a prof-of-concept implementation if anyone is interested in continuing to work on this.