From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 08 16:33:35 2023 Received: (at submit) by debbugs.gnu.org; 8 Feb 2023 21:33:35 +0000 Received: from localhost ([127.0.0.1]:56814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPs4M-0004pM-Or for submit@debbugs.gnu.org; Wed, 08 Feb 2023 16:33:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:34750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPs4K-0004pC-66 for submit@debbugs.gnu.org; Wed, 08 Feb 2023 16:33:32 -0500 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 1pPs4H-00038r-QP for bug-gnu-emacs@gnu.org; Wed, 08 Feb 2023 16:33:30 -0500 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPs4G-0000WB-18 for bug-gnu-emacs@gnu.org; Wed, 08 Feb 2023 16:33:29 -0500 Received: by mail-qt1-x82b.google.com with SMTP id v17so22579019qto.3 for ; Wed, 08 Feb 2023 13:33:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=PXL1J212wwT4ZFrNdkSFe5/DgHX9BALD0WrlJ/FGCKs=; b=jNwpvluuNZqETPBcWppDOu+zhFkAkRJRrPBHJS7dRxMUpbSsmuRHKkUyRu2a4xFn7k EoLC6OqiVoeSrqSbAlv0gOPpI+Zr1aJjhupTb3xKC2hhvVFhHv/B9VvB68RJOTrigkYI uEONJbMGXIksKcPqJjVvuPMHB6+EY/MBTGM9LvsYwG58lufmExgkRQe29zKPE/DyESCi dqttmDBBGttu+hqO8NyXV/+DrUfxBf5LqPjbN73Q3f99+w466WqVWz//hVnwXCH0CYSQ XYVXtakSgoV28xww2N8bMB3hRq+fuya81YGF/T91ryQGkFklfwWgFMXYU9bOp4qEMkQH PwyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PXL1J212wwT4ZFrNdkSFe5/DgHX9BALD0WrlJ/FGCKs=; b=rOUjwkj7MdEcfApkgOk4jrAJ6b8hSZMmGn3QkPlcGVv/QnHIpB8iNDzPZcnJAL3Koi av46Zgh3rGhgHuTtIfTmJV+HyQGuvntsdDk2HXX35eKwQX63Y1gAXEZ+P6sjYBFXE4gn SRo/vNl3b5whbMRFOcVu76ZiPSoYl0DfeLo4DuXSo8zIhH/Sqhd23f1em87HmLYqllwv e/hmkcHHsL0y47SK57Q25wvnqVqR19iZEL/b4Dpx21W1X/2hIjGddf3YfN9EnNEr0vDq vn5Jcrh5al3CsjqxyH6SXsmpaAbEchYTzZ2/5PX/RATn86JwM/jn4ZyJOTWJIk2quDw+ XqWQ== X-Gm-Message-State: AO0yUKW0CLDGF+5EwyGZlRD8uuK2+mXHVEPOJJbmsoNOqmpEPFktHBNp XZkDEIDBKhkAe26mDUM6ougyvRJZXXE= X-Google-Smtp-Source: AK7set+W2DtTMlApguNPTpy/5BC2FHf2Z7KJ+tDoZQr4g1IvcHU17yxqHUaSqsGNMiWNBqHVCgm38A== X-Received: by 2002:a05:622a:c7:b0:3ba:1398:c68d with SMTP id p7-20020a05622a00c700b003ba1398c68dmr14827094qtw.16.1675891999594; Wed, 08 Feb 2023 13:33:19 -0800 (PST) Received: from smtpclient.apple ([131.183.131.75]) by smtp.gmail.com with ESMTPSA id s25-20020a05620a16b900b0072ed644bb0dsm11542467qkj.97.2023.02.08.13.33.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Feb 2023 13:33:18 -0800 (PST) From: JD Smith Content-Type: multipart/alternative; boundary="Apple-Mail=_3560A896-AD34-4C96-9547-1284CFCE2766" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Eglot patch: add customization to prefer plaintext for :hover Message-Id: <75664907-6B17-43AC-B372-724DA6E7BA42@gmail.com> Date: Wed, 8 Feb 2023 16:33:16 -0500 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::82b; envelope-from=jdtsmith@gmail.com; helo=mail-qt1-x82b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --Apple-Mail=_3560A896-AD34-4C96-9547-1284CFCE2766 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Some LSP servers badly mangle their responses to :hover into markdown = that gfm-viewmode cannot render. See this discussion = , for example.=20 The attached patch adds a new custom option `eglot-prefer-plaintext=E2=80=99= which configures the server to use plaintext for :hover responses, even = if Emacs could in principle handle markdown. Unfortunately, the popular = Python LSP server in question (pyright) is not interested in improvement = to its generated markdown (since it "works in VS-Code=E2=80=9D). = Luckily the plaintext docstrings of most packages are very nicely = formatted.=20 --Apple-Mail=_3560A896-AD34-4C96-9547-1284CFCE2766 Content-Type: multipart/mixed; boundary="Apple-Mail=_D7B22108-EAC4-4882-8426-BB0C24CB1C27" --Apple-Mail=_D7B22108-EAC4-4882-8426-BB0C24CB1C27 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Some LSP servers badly mangle their responses to :hover into = markdown that gfm-viewmode cannot render.  See this discussion, for example. 

The attached patch adds = a new custom option `eglot-prefer-plaintext=E2=80=99 which configures = the server to use plaintext for :hover responses, even if Emacs could in = principle handle markdown.  Unfortunately, the popular Python LSP = server in question (pyright) is not interested in improvement to its = generated markdown (since it "works in VS-Code=E2=80=9D).  Luckily = the plaintext docstrings of most packages are very nicely = formatted. 

= --Apple-Mail=_D7B22108-EAC4-4882-8426-BB0C24CB1C27 Content-Disposition: attachment; filename=eglot_plaintext.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="eglot_plaintext.patch" Content-Transfer-Encoding: 7bit --- eglot.el~ 2023-02-08 12:45:57.000000000 -0500 +++ eglot.el 2023-02-08 12:48:26.000000000 -0500 @@ -369,6 +369,10 @@ "If non-nil, activate Eglot in cross-referenced non-project files." :type 'boolean) +(defcustom eglot-prefer-plaintext nil + "If non-nil, always request plaintext responses to hover requests." + :type 'boolean) + (defcustom eglot-menu-string "eglot" "String displayed in mode line when Eglot is active." :type 'string) @@ -734,7 +738,8 @@ :contextSupport t) :hover (list :dynamicRegistration :json-false :contentFormat - (if (fboundp 'gfm-view-mode) + (if (and (not eglot-prefer-plaintext) + (fboundp 'gfm-view-mode)) ["markdown" "plaintext"] ["plaintext"])) :signatureHelp (list :dynamicRegistration :json-false --Apple-Mail=_D7B22108-EAC4-4882-8426-BB0C24CB1C27 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii

--Apple-Mail=_D7B22108-EAC4-4882-8426-BB0C24CB1C27-- --Apple-Mail=_3560A896-AD34-4C96-9547-1284CFCE2766-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 14 21:37:21 2023 Received: (at 61373) by debbugs.gnu.org; 15 Feb 2023 02:37:21 +0000 Received: from localhost ([127.0.0.1]:57494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS7fd-0002wj-Lj for submit@debbugs.gnu.org; Tue, 14 Feb 2023 21:37:21 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]:46074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS7fb-0002wW-Mh for 61373@debbugs.gnu.org; Tue, 14 Feb 2023 21:37:19 -0500 Received: by mail-qt1-f181.google.com with SMTP id h24so20456474qta.12 for <61373@debbugs.gnu.org>; Tue, 14 Feb 2023 18:37:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FP1Yp9TBXbBudz41kqdG2V7V945RZLcWMjUgDesy06g=; b=JFQj9raB5NzyBbDvJgMbHAXPB2URCX64Jf4mMoLXA3xtOhyMKMH9aqk0MkcmKoi8CP fzGhVmUObdQCnmRXzJuJPaqHL7fb+2vFdPhTkXKoWYPDDf4DjaEP72SqNRYAJ1MOsm6M 7jQkujp6N9Vpb0T6EKKBVUdLdGJQmU9OWCTY3BS9K6QejrO2GfsgsZjjUbA53iqKlDMT WBwnCev5xACMShAtT/fsB7bXdav/15Sjwbl4XAxbZm8ECZ0B/I541Eq+XKr110E4lfsc V3t6Og/DAXLsJ/eBigFvCDRwlijhsfZnrFPsKs7Dz5OccWo4nTOWekFpHpr7gkw2ACAY Zqag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FP1Yp9TBXbBudz41kqdG2V7V945RZLcWMjUgDesy06g=; b=c2WN+0Zr/RHRuIHXGuMpj+8SoYWfP75eBPHgYhKQt3yVEvEG/nSl7ereZAu1ZreIK8 vPH2Pt6O+aSn/+rQsCDHS1G4py5NudOUTVLs4H7lTlhavpJBu0hg5SB66lxr6KYqiqGt KtSYpW6RQMHWiiM79UTvHM/ez/FRA6KiXmwVIt6VuAyvCt3gmAM8fH0YprA+8drujTkm TAmUvbC831DdV8NMgSEtJDo8Q03a9NxY2I70KcIcH4sXS9Ux80+1uGPL7jiOJy1ERLLe ijCkTvs/x67wjQUzOSqTThe/M8PLal+omRC6rv5Xb5Z7HkxpopVxUhohrOzB/CtrR2Mg g01A== X-Gm-Message-State: AO0yUKVrRoXdO5fFBubwRJrt4AG3mm1HgNiLxn6sJpLAmRmp30DBWSxG eVoKpZd/vvtBEFl1HRH0y7gC6jRnF/eynw== X-Google-Smtp-Source: AK7set8p0tmEGnT19DxTWsEX/5wDf7c8lxAXRXUHV2+y7s5kxQYEqvXYJJDJ+jTpMDbz4B5/aVMYzQ== X-Received: by 2002:ac8:5f07:0:b0:3b6:a1c2:f63c with SMTP id x7-20020ac85f07000000b003b6a1c2f63cmr771760qta.33.1676428633542; Tue, 14 Feb 2023 18:37:13 -0800 (PST) Received: from smtpclient.apple (cm-24-53-184-207.buckeyecom.net. [24.53.184.207]) by smtp.gmail.com with ESMTPSA id x12-20020ac8700c000000b003b0766cd169sm12370559qtm.2.2023.02.14.18.37.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Feb 2023 18:37:12 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#61373: Acknowledgement (Eglot patch: add customization to prefer plaintext for :hover) From: JD Smith In-Reply-To: Date: Tue, 14 Feb 2023 21:37:11 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <1AD5C8B5-97F2-4807-9090-B95DBE093667@gmail.com> References: <75664907-6B17-43AC-B372-724DA6E7BA42@gmail.com> To: 61373@debbugs.gnu.org X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61373 Cc: joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Copying in Jo=C3=A3o. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 23 17:23:33 2023 Received: (at 61373-done) by debbugs.gnu.org; 23 Mar 2023 21:23:33 +0000 Received: from localhost ([127.0.0.1]:39450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfSPF-0005ua-7W for submit@debbugs.gnu.org; Thu, 23 Mar 2023 17:23:33 -0400 Received: from mail-ed1-f41.google.com ([209.85.208.41]:45870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfSPE-0005uN-6o for 61373-done@debbugs.gnu.org; Thu, 23 Mar 2023 17:23:32 -0400 Received: by mail-ed1-f41.google.com with SMTP id t10so397099edd.12 for <61373-done@debbugs.gnu.org>; Thu, 23 Mar 2023 14:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679606606; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6SyoluRaIIyQ2zYtLY+d5110qPonxVi5++SgPzpE4HQ=; b=XtLRgGOiXXaasZ3SThi6IQzc/INdOqSJg+R9zRoK1smoA1Wl953tWwCfU5WaAJcuf6 dLTisxYhbFDKBuwkxHKfTcnL3arcvTuIn2yiWdPChdNmjtiMLmqsETyzz1Ag32E43fxC /0fc9fCX/pwp/odBixgQaPaDWRGjBSFA/O+bgnU4DIqjumGIfbA8uUYUy8AUXIpSBLNW GJvqWyAmYNur5wsr4SL5QK4d5NG3hAZbTWpVRVSuz9x6q1Uc0iJBXNfMzBvea4Vc3+n5 1wj+V+jdvtF1Hqn0d9l36pPTV3Z8fO1TDKBtmDozuL38tvjisnCpRFETjb9eaDSmRbFx t8eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679606606; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6SyoluRaIIyQ2zYtLY+d5110qPonxVi5++SgPzpE4HQ=; b=u2C5XZATPBySRjh+Is29PSICE7pmNLJ1suWUaeGJSBNxmlZZ/cUdzJ9IoPBAAlewR8 khmb7kFT4v4ysTmsQq1+xXgeHuZlL4xzAlifzLBXGX5DBRGDdmPMuv0cOt+EEt4mNkyv lj5CFxkDTavREca7YlHD5nQs7y83naGYweY+yxVSD+/vpBfUobe2qha1aong4Q3/f2mb vq2qMYqRiLiICQhopCB8/xx1FwuSECb5DMpzkxgpqaawCkpagmn13BNOq9xUuWVNDFUS 0lZaKQpAFU3GwBBOBx1rEBcDw2vRl2By0qkVVazjn/861Kmja3sIAvzUUCUxQG8V2Hz4 dYLg== X-Gm-Message-State: AO0yUKV17l/aSEqz38O0m4edZtZpRd9g+yyXjsvc+OE3zWtHQtHTx0qr cYHOGj8JwrDC2PzTVZXm/AxQURMzE4g= X-Google-Smtp-Source: AK7set8KlFMWwgOEkBKJy0vqW6XgEnWwuafIVYhdAG+q2Qq1/2qWyBMt3kuQO2aOlTOQ0eNdN0n+eA== X-Received: by 2002:a17:906:79c7:b0:931:54:f24d with SMTP id m7-20020a17090679c700b009310054f24dmr6695404ejo.22.1679606606035; Thu, 23 Mar 2023 14:23:26 -0700 (PDT) Received: from krug (87-196-72-75.net.novis.pt. [87.196.72.75]) by smtp.gmail.com with ESMTPSA id f23-20020a1709064dd700b00931536d461fsm9153163ejw.20.2023.03.23.14.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 14:23:25 -0700 (PDT) From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= To: JD Smith Subject: Re: bug#61373: Eglot patch: add customization to prefer plaintext for :hover In-Reply-To: <75664907-6B17-43AC-B372-724DA6E7BA42@gmail.com> (JD Smith's message of "Wed, 8 Feb 2023 16:33:16 -0500") References: <75664907-6B17-43AC-B372-724DA6E7BA42@gmail.com> Date: Thu, 23 Mar 2023 21:25:26 +0000 Message-ID: <875yardut5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61373-done Cc: 61373-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) JD Smith writes: > Some LSP servers badly mangle their responses to :hover into markdown tha= t gfm-viewmode cannot render. See this > discussion, for example.=20 > > The attached patch adds a new custom option `eglot-prefer-plaintext=E2=80= =99 which configures the server to use plaintext for : > hover responses, even if Emacs could in principle handle markdown. Unfor= tunately, the popular Python LSP server in > question (pyright) is not interested in improvement to its generated mark= down (since it "works in VS-Code=E2=80=9D). Luckily the > plaintext docstrings of most packages are very nicely formatted. Hi, I've pushed your patch to master: commit 4566a0c6b825a18e6c065da0543b8b942b7db8df (HEAD -> master, origin/mas= ter, origin/HEAD) Author: JD Smith Date: Thu Mar 23 17:43:52 2023 +0000 Eglot: let user opt-in to plaintext LSP docs (bug#61373) * lisp/progmodes/eglot.el (eglot-prefer-plaintext): New variable. (eglot-client-capabilities): Use it. Copyright-paperwork-exempt: yes I opted noted not to describe eglot-prefer-plaintext in the manual, because I think this option should ultimately live in ElDoc, not in Eglot. Properly supporting markdown rendering in Eldoc is hard though, so there's little reason not to push this simple workaround. Closing this bug. See also bug#61072 and bug#62029 for more discussion. Jo=C3=A3o From unknown Sun Aug 17 09:09:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 21 Apr 2023 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator