From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mekeor Melire Newsgroups: gmane.emacs.bugs Subject: bug#62687: 30.0.50; Eglot (eglot--sig-info): SignatureInformation's Documentation is never shown when it's of type MarkupContent Date: Thu, 06 Apr 2023 19:49:08 +0000 Message-ID: <87wn2on4jj.fsf@posteo.de> References: <875yaanfuv.fsf@posteo.de> <871qkwolez.fsf@posteo.de> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: joaotavora@gmail.com To: 62687@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 22:26:19 2023 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 1pkWBX-0004wJ-PI for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 22:26:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkWBJ-00020s-O9; Thu, 06 Apr 2023 16:26:05 -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 1pkWBH-00020e-Q0 for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 16:26:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkWBH-0002Wa-BV for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 16:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkWBG-0003aT-AJ for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 16:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mekeor Melire Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2023 20:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62687 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168081272113729 (code B ref -1); Thu, 06 Apr 2023 20:26:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Apr 2023 20:25:21 +0000 Original-Received: from localhost ([127.0.0.1]:55276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkWAb-0003ZN-21 for submit@debbugs.gnu.org; Thu, 06 Apr 2023 16:25:21 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkWAW-0003ZB-Nx for submit@debbugs.gnu.org; Thu, 06 Apr 2023 16:25:19 -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 1pkWAW-0001Nk-7c for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 16:25:16 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkWAU-0002E3-6E for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 16:25:15 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0FE33240326 for ; Thu, 6 Apr 2023 22:25:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1680812712; bh=B7Olk5pe1tJpdR5bXtbLC8wupdzcU9sYuOxMWnEB8SM=; h=From:To:Cc:Subject:Date:From; b=XcOVHm5i9kLK0EGlYl8hQ8WXTyDoPVB4ThLf/k0UCP+gkYodRyaWnbmUkBSpXNQzs mRCspmQsXp7rws7IW0r7DS0B/tQgsPeOnUFoipqBkwrTBhSmSdFYqvurKwT5tuL+tA 4Lg88L640eaa21e0SiJeYg456BIQYZo0okQ901C8xWWz51u13SfKPkhzebhH0uWdxk s7AQK8L7zbgHHTs7O2myc4lTfjj1ufAIYMsZuXlSaEp1SedaBYEUL2ubtTT+DnrXTT QZDno7tN5omQ/C3Ulfu8I3WcbS99ZX+lcLBO2/rzfph2VJmjciPblmZBwCwmcQX8LH r4oD7kE46jLBg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PstKM1PTGz9rxD; Thu, 6 Apr 2023 22:25:11 +0200 (CEST) In-reply-to: <871qkwolez.fsf@posteo.de> Received-SPF: pass client-ip=185.67.36.65; envelope-from=mekeor@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:259355 Archived-At: Let's take a closer look at the relevant code snippet; understand its bug; understand its features; and try to come up with a solution. 2023-04-06 19:21 mekeor@posteo.de: > (when (and (stringp documentation) This line is the reason why the documentation is only echoed if it's of type string, and why it will never be shown in case it's markup content. > (string-match "[[:space:]]*\\([^.\r\n]+[.]?\\)" > documentation)) > (setq documentation (match-string 1 documentation)) Here, we trim the beginning of the documentation-string and extract the first sentence; or rather: We extract the text up to the first dot. (I guess here is another bug because this regex will cut "a().chain().like().this()" (which might occur inside a documentation-string) off right after the first dot.) I guess, the motivation for these lines is to reduce the size of the echoed documentation message; i.e. prevent flooding of the echo-area. Large echo-areas take up much of the screen and are annoying. Personally, I don't think that we should extract only one sentence or so. Instead, I think, `max-mini-window-height' (and `eldoc-echo-area-use-multiline-p') suffices to configure the maximum size of the echo-area. But, if we decide to stick to the idea of only echoing the first sentence, then I wonder: How do we implement this feature for documentation-markups? How to extract the first sentence of a markup? `string-match' would not work, right? > (unless (string-prefix-p (string-trim documentation) label) This line makes sure that we do not echo the "first sentence" of the documentation-string if it's a prefix of the label. How often does this happen? Has this been reported as a bug before? It seems rather unlikely to me. Also, if we decide to stick to this feature, then I wonder: How to recreate the logic of `string-prefix-p' for documentations of type markup? > (goto-char (point-max)) > (insert ": " (eglot--format-markup documentation)))) Here, we finally format the "first sentence" of the documentation-string and insert it into the temporal buffer which will be echoed later. Also, does it make sense to pass a documentation of type string into `eglot--format-markup' which will format it as GitHub-Flavored-Markdown (GFM) although the documentation is not of type markup?