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#61072: How to change the length of the separation lines in eldoc, used by eglot? Date: Thu, 23 Mar 2023 21:53:18 +0000 Message-ID: <87zg83cey9.fsf@gmail.com> References: 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="29638"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61072@debbugs.gnu.org, jblevins@xbeta.org To: Wei-Ting Lin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 23 22:52:23 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 1pfSr9-0007WU-B5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Mar 2023 22:52:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfSqq-0004tI-NJ; Thu, 23 Mar 2023 17:52:04 -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 1pfSqo-0004sr-Pk for bug-gnu-emacs@gnu.org; Thu, 23 Mar 2023 17:52:02 -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 1pfSqo-0008T5-IB for bug-gnu-emacs@gnu.org; Thu, 23 Mar 2023 17:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pfSqo-0006lQ-4L for bug-gnu-emacs@gnu.org; Thu, 23 Mar 2023 17:52: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: Thu, 23 Mar 2023 21:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61072 X-GNU-PR-Package: emacs Original-Received: via spool by 61072-submit@debbugs.gnu.org id=B61072.167960828525954 (code B ref 61072); Thu, 23 Mar 2023 21:52:02 +0000 Original-Received: (at 61072) by debbugs.gnu.org; 23 Mar 2023 21:51:25 +0000 Original-Received: from localhost ([127.0.0.1]:39497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfSqD-0006kX-A3 for submit@debbugs.gnu.org; Thu, 23 Mar 2023 17:51:25 -0400 Original-Received: from mail-ed1-f46.google.com ([209.85.208.46]:37467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfSqA-0006kG-WD for 61072@debbugs.gnu.org; Thu, 23 Mar 2023 17:51:23 -0400 Original-Received: by mail-ed1-f46.google.com with SMTP id cn12so753829edb.4 for <61072@debbugs.gnu.org>; Thu, 23 Mar 2023 14:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679608276; 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=suNKXjeAX6A8zYTr5oR2+NoSgWaEn7GgKnsDU7L3Vbk=; b=pjZoIkrz+x5ly1lSs727nM9594bNdqsoUEjbbMmo9PamfRRu52aIU31Jo3NZuTqSwo 2bzuNriWBY30xoGUON8XkYajmwAsqQ6DoAOJ+o3Xp2k82C/57wGwigo3Dl46eNmxEdvo mwARkbgk0QBqKDOzllONoemUvRCTciZetIewJV1bdy5AOSEG/JK75jXA/VlCyEFTNhaD 33dTKPcAQ+fLO7ShSkfm6uOxKlXpVX8p3DfhG3MaL6iSF6qWIBEpulL3VWtnjfMFXeYw 1K6eqz8drOBaIyUL3eB8B2Glew0D8eS4Us7nCBFC5HhRaG2LCP7RfTw7NyTTohYatpvC 0fpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679608276; 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=suNKXjeAX6A8zYTr5oR2+NoSgWaEn7GgKnsDU7L3Vbk=; b=hh1Z+3TGv/fIHBbAM9JLeAPUoE3tSBOAkUNoFXtVl6l45g7dKZLQ4sOdqHOt3DC2dz 8MSd3Q8D2OedthwMOdCIDdYDRb4QSK3b6MwXEmVs7H1thJRwuEZg3M+Mc1nWGlCtCMat c73m+N+On29k0xroUyhT+70q0EHvdUKCsge8PPEP+bDTYoxaNvbtHBnt7y2mpN3hYnMn yoFO5tzQSeWiX9SJmgdXklH6yNKiN7MJjR7reLQrrG8chu7/dH1eoFiK6Pcli3dn0GGN ZBfcfawo0w2q7G45wWM4fKCUk9HoRmD93Dotlbx1G4HTrHLS0FydStWw9uS/5FqVb95b ca9w== X-Gm-Message-State: AAQBX9eRMdjkeC5nMDWu8yd2J0LiYp+c6E+l4fKz8sf56ckn9dWMHnYz ZDHSHc57tA/UUS1H2qWuk08= X-Google-Smtp-Source: AKy350Y9YV5M4ItAMWgNGcY4nHQMDNEa52+YbKBFWhc+rJ2O8rVi4gezzAMiCuH4NMe+I6J6sv3W4Q== X-Received: by 2002:a17:906:1d43:b0:92b:6b6d:2daf with SMTP id o3-20020a1709061d4300b0092b6b6d2dafmr444119ejh.77.1679608276562; Thu, 23 Mar 2023 14:51:16 -0700 (PDT) Original-Received: from krug (87-196-72-75.net.novis.pt. [87.196.72.75]) by smtp.gmail.com with ESMTPSA id g10-20020a17090670ca00b0093b8c0952e4sm2773860ejk.219.2023.03.23.14.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 14:51:16 -0700 (PDT) In-Reply-To: (Wei-Ting Lin's message of "Wed, 25 Jan 2023 20:42:26 -0500") 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:258484 Archived-At: Wei-Ting Lin writes: > As seen in the screenshot, the line is too long for the child frame and g= ets wrapped. How can I change the length of the > line? > This issue was posted in https://github.com/joaotavora/eglot/discussions/= 1157 originally.=20 Hello, I'm sorry for the long delay in replying to this. I've investigated this issue today. This issue in on my radar with lots of other related Eglot/ElDoc issues (see for example bug#62029) I think this one specifically is coming from the markdown.el library (https://jblevins.org/projects/markdown-mode/). I'm copying in the maintainer, Jason Blevins. Jason, you're probably out of the loop. Eglot is using gfm-view-mode to "render" Markdown snippets in temporary buffers, so it can then shoot that results as a propertized string to ElDoc, which shows it in different outlets (buffers, echo area, child frames, etc. The very long separator we're seeing in the screenshot is markdown.el's way of rendering Markdown horizontal rulers. There, it uses this code: (defun markdown-fontify-hrs (last) "Add text properties to horizontal rules from point to LAST." ... `(display ,(make-string (1- (window-body-width)) hr-char))))) ... t))) As we can see, `window-body-width' is used, which is problematic because it creates text with a display spec which might not match the size of the window used for showing this text. Instead, markdown.el could use something like propertizing that text witha special face, which doesn't suffer from this shortcoming. To see how it behaves, evaluate this code (with-current-buffer (pop-to-buffer "*test*") (insert "foo\n") (insert (propertize "\n" 'face '(:inherit separator-line :extend t))) (insert "bar\n") (insert (propertize "\n" 'face '(:inherit separator-line :extend t))) (insert "baz")) While we're on the topic, there are other things that could make markdown.el much more useful for ElDoc/Eglot's purposes, like being able to "fill" paragraphs regions to specific lengths (maybe infinite lengths, so that visual-line-mode can do its thing) Jo=C3=A3o