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: Acknowledgement (eglot: RFE: recenter buffer upon showDocument request) Date: Sat, 13 Apr 2024 11:10:54 +0200 Message-ID: <8734rpmxup.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37999"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: martin rudalics , 70193@debbugs.gnu.org To: Eli Zaretskii , adonovan@google.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 13 11:12:22 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 1rvZQs-0009i8-9u for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Apr 2024 11:12:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvZQQ-00028U-7C; Sat, 13 Apr 2024 05:11:54 -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 1rvZQO-000280-BK for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 05:11:52 -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 1rvZQO-0003dI-3E for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 05:11:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rvZQY-0003nN-Ea for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 05:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Felician Nemeth Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2024 09:12: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.171299947714193 (code B ref 70193); Sat, 13 Apr 2024 09:12:02 +0000 Original-Received: (at 70193) by debbugs.gnu.org; 13 Apr 2024 09:11:17 +0000 Original-Received: from localhost ([127.0.0.1]:60125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvZPn-0003ge-NZ for submit@debbugs.gnu.org; Sat, 13 Apr 2024 05:11:17 -0400 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:58672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvZPk-0003fp-WD for 70193@debbugs.gnu.org; Sat, 13 Apr 2024 05:11:14 -0400 Original-Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-343d1003106so1092770f8f.1 for <70193@debbugs.gnu.org>; Sat, 13 Apr 2024 02:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712999456; x=1713604256; darn=debbugs.gnu.org; h=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=NJ3FsD2PdIDPPlxW2Qm7re+61T9EQH5j23mmbaPT8Rs=; b=hNW+l1x/eigA3CQK4gvPRwKSAePfe2ma9xqD98IyEN0TWqxAcyxL26gcaqLyeC7IPh 9No9C/Hp3ephwA7QPvYDSJECQrQuFtvWm+PKJW9gqTH1tEISHEWhfhk6fyS8gFA7D/sU jgZslUNLIJWZea5gfh5JU1aQNzBbIoOm3ILVGqjE97EiAGTYB5vAk82+vUkDuPM9B2Kv ldM+nOsdJY0IKg39vrNZ5I7BrVUQZKurJFOuy6a3ShezCg/Wtz/vWAIBWPUWIezvy+HM L2kN4a2/+C+Ke5idFheIE7ObCpqvJDwYSUbhtX1Tt7ku386detFBkLai15bdWeA6gn3h EyFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712999456; x=1713604256; h=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=NJ3FsD2PdIDPPlxW2Qm7re+61T9EQH5j23mmbaPT8Rs=; b=dggDnIFwEgZmEVXTgwJiwskB+DhBxXX5lKgPpdLVIosfxg0z4RrUXdP97Ev9WLrCvV E07GEXcDziQYkUtgd2ytlFUYuU7wKiuvtDb47zCuaicq1GCL277rV+2GgPHsiyewoduW LJbdS33Yxvppd1Gr9FiW9L5aDXZ/6e844pBH3Ed0NP46sCBmbRdwRBpAvpUoZBk+cdpr A9IDmCLP86zVAZR7sV5H59JF4jaYXdLfmYTo4NZaqkI2L243WQsT8Hm445Sj3ali9AG+ 54z13FgZR/5Y7czizZ+S5CC/2uLgUiqTaDa9UQEbJpSr3dVIOmL20bAw4gIbYDxjY4gA Bccw== X-Forwarded-Encrypted: i=1; AJvYcCV/vTER1SGVWg5X5E2/Z3+rLM3JfoxAwjzImNfgeNLg6M7brjOQVA0PvP5uapinlOqkMovFtNsmHXh6fc3L9vq3xQdKbYI= X-Gm-Message-State: AOJu0YzZv950JWkk2Mbc3vOadBLe5kyqDPFDnzRWO/ArOTBDr/baqQlX 2rk7QiSOd35zIjbSJ7+OrZ34qv3TIT53RcNTrjIsY4xQFdV+WsFSV6NzRg== X-Google-Smtp-Source: AGHT+IEOXalwB+KzS+EdzatteoJzh4nhRPRh8cPUoh2NMvfuhgFmwKxf6Wp7HUXPVO13XC6xzp6BZA== X-Received: by 2002:a05:600c:5493:b0:417:ca54:e9de with SMTP id iv19-20020a05600c549300b00417ca54e9demr4807309wmb.41.1712999455959; Sat, 13 Apr 2024 02:10:55 -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 k21-20020a05600c1c9500b004182a36b185sm892045wms.2.2024.04.13.02.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 02:10:55 -0700 (PDT) In-Reply-To: <867ch1r8g3.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Apr 2024 11:08:28 +0300") 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:283192 Archived-At: Eli Zaretskii writes: >> Cc: Alan Donovan , 70193@debbugs.gnu.org >> Date: Sun, 7 Apr 2024 09:30:02 +0200 >> From: martin rudalics via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> > But when I debug window-recenter-region-start-position, the height is >> > set to 0. The patch below seems to fix the problem. >> [...] >> > + (body-pixel-width (window-body-width window t)) >> > + (body-pixel-height (window-body-height window t)) >> >> You're right. I meanwhile fixed the code to calculate how many lines to >> step backwards by using 'window-text-pixel-size' there too. So now this >> should work with text scaling and varying line heights too. >> >> If you want to test it with 'recenter-region', then a rough estimate is >> that the number of lines shown after the first "L:" should be equal to >> or one less than the number of lines shown after the third "L:" in each >> message issued. > > I'm unsure how to proceed with this bug report. Should it be closed, > or is there anything left to be done here, and if the latter, then > what has to be done to resolve the issues? Sorry, I meant to write back earlier. I've done some limited test for varying line heights as well, the patch seems to work well. The question, I think, is whether this is generally useful enough to have a polished window-recenter-region to be part of Emacs, or should it just be added to Eglot. In the original report, showDocument requested to show a source code file, where I think `reposition-window' would be more useful. Alan, can you check whether your use-case is better served with `reposition-window' than with `recenter'? However, the LSP specification does not guarantee that the target of showDocument is a source file, so Eglot needs window-recenter-region for completeness. Also I don't know if reposition-window supports every programing language or "go" in particular.