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: Tue, 28 Mar 2023 23:27:27 +0100 Message-ID: <87jzz0se9c.fsf@gmail.com> References: <871qmyn51d.fsf@betli.tmit.bme.hu> <87pma3gcyw.fsf@betli.tmit.bme.hu> <87r0tq8bgp.fsf@betli.tmit.bme.hu> <87wn37ceo6.fsf@gmail.com> <87o7oc6h5b.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="24316"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61072@debbugs.gnu.org, Wei-Ting Lin To: Felician Nemeth Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 29 00:27:20 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 1phHmh-0006D7-Qm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Mar 2023 00:27:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phHmS-0002Cu-Qj; Tue, 28 Mar 2023 18:27: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 1phHmQ-0002Ck-Oe for bug-gnu-emacs@gnu.org; Tue, 28 Mar 2023 18:27: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 1phHmQ-0001fl-8o for bug-gnu-emacs@gnu.org; Tue, 28 Mar 2023 18:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1phHmQ-0001N9-3R for bug-gnu-emacs@gnu.org; Tue, 28 Mar 2023 18:27: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: Tue, 28 Mar 2023 22:27: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.16800424085252 (code B ref 61072); Tue, 28 Mar 2023 22:27:02 +0000 Original-Received: (at 61072) by debbugs.gnu.org; 28 Mar 2023 22:26:48 +0000 Original-Received: from localhost ([127.0.0.1]:50834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phHmC-0001Me-BR for submit@debbugs.gnu.org; Tue, 28 Mar 2023 18:26:48 -0400 Original-Received: from mail-wm1-f49.google.com ([209.85.128.49]:41754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phHmA-0001MR-GX for 61072@debbugs.gnu.org; Tue, 28 Mar 2023 18:26:47 -0400 Original-Received: by mail-wm1-f49.google.com with SMTP id r19-20020a05600c459300b003eb3e2a5e7bso8481127wmo.0 for <61072@debbugs.gnu.org>; Tue, 28 Mar 2023 15:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680042401; 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=hivMUpRvLgCBFWwYagOOzQMXN02449dUmNe3qh4bing=; b=Y7C6Ks2oXec6YTSZiND8ztYOYnd8D9NMI8SQNJHThSxlcPJVsZfs+r3cI/XCU512pb T0g6q2i4qnrmqkAPoBB5hydeqeI2FJ5sBXqOSgB1XhQgs8oLF09oI5O+HkElHzvtu6dl WoDvj/ZDF71isCdwd1GBHCu58MyvIEZu8mDqKHVhxRyLH4NvBhX2GQsWKZW0pxYPfco2 jaDlEQZuIi+SbBIQKjwjMEvC8UZRjw7Jb4H467rBS/uQIFfVYgmB33xA8VQ/gKb/V0QJ HP1h09Htd88yIb7c7pkUXqJ5FvHIIzcoKY5XpgKEubWnIgp14YvqZ6NVmUX3rB+2SuDD TXvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680042401; 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=hivMUpRvLgCBFWwYagOOzQMXN02449dUmNe3qh4bing=; b=Y8ybKOPwrV4GgFYEU1qQKLNZovro9oHDqY1D5AQjblZXVY/rdoJ7cJvqUYEKLW4VdS EBBUvFX73nnB9g1pbC4rdH94/Rk3040pKfCjzDA44q7ogsXyPorCeoUK3/tQ7U6ZQ0ni jWQumCYrYABi821D8LqYfLP4xJhDEe7DVRLK93GuVQqFgH0uh8+QPapWeAAB+3maATIK KiOqMM654Im5o2gqvPxxTQBH88/bkNi3gy+K4QEjoGEjRGTA5ieTQhmHJ2P49NQNyUx0 V9CueUFChVYpnm9Blr7aEzb5YhTW9I9f1kWG4Mkt4ZyRb/P31aCUyi81YoXhXW2rr4Bm ocOQ== X-Gm-Message-State: AO0yUKUyGwx24OK1nnnjAIjxS7PemPkF/Xu+rlPYP709zDDP00r+EZDO XeKgEb8S/+sOo5mZL5Q6EdI= X-Google-Smtp-Source: AK7set+uJxURyS2D1Pwx+T+Bf13c9AqIOcXCS4K+zFOOGDcDohZdkBg1j2mxfTq8V+3Pwlelz8Q7Ig== X-Received: by 2002:a05:600c:209:b0:3ee:282d:1016 with SMTP id 9-20020a05600c020900b003ee282d1016mr12739977wmi.25.1680042400693; Tue, 28 Mar 2023 15:26:40 -0700 (PDT) Original-Received: from krug (87-196-72-128.net.novis.pt. [87.196.72.128]) by smtp.gmail.com with ESMTPSA id fc11-20020a05600c524b00b003ebff290a52sm132362wmb.28.2023.03.28.15.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 15:25:42 -0700 (PDT) In-Reply-To: <87o7oc6h5b.fsf@betli.tmit.bme.hu> (Felician Nemeth's message of "Tue, 28 Mar 2023 17:16:00 +0200") 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:258829 Archived-At: Felician Nemeth writes: > Jo=C3=A3o T=C3=A1vora writes: > >> See docstring of eldoc-documentation-functions. > > The docstring is quite easy to follow. Nice work. > >> I stopped short of adding :content-type there. There's not much point >> in moving rendering from Eglot to ElDoc if the rendering is going to >> suck just as bad. So I think this has to be analyzed carefully. Here >> are some ideas: >> >> 1. Use eww to render HTML, as you suggest. But how to get that HTML? >> Call an external process? > > My idea was to leave the door open for a potential ElDoc backend that > produces raw HTML documentation. But it is a half-backed idea. I don't > know how images should be specified. Just as an IMG tag: src=3D"example.jpg">. Or inline like in an email. > > If I understood correctly, one of your original ideas was to let ElDoc > backends (Eglot) to specify a flag whether the documentation was in > markdown format. Using terminology of the > eldoc-documentation-functions, I simply suggested a :content-type key to > generalize the markdown flag hoping Emacs had helper functions to help > handling a content-type specification. Yes, exactly. I ended up not following up on my idea because we don't have a very good markdown renderer yet, so it's not particularly useful to introduce this indirection yet. And this content-type idea of yours seemed more generic, more ambitious, and generally better. > Unfortunately, I now see a small problem with the :content-type > approach. How should Eglot know whether ElDoc can render a markdown > formatted documentation? If Eglot can request the documentation in > multiple formats, how it should know which one to choose. I was going to just have Eglot ask Eldoc: "do you support Markdown?" and then report the corresponding capability to the server. >> 3. Lobby for markdown.el to become more render-friendly, (remove hard >> newlines from paragraphs, remove invisible text, etc.) > > Sure, but can a better markdown.el solve the original issue? Is there a > way to render a separation line independently of the current > window-width? Yes, there is, with just the same code we use in eldoc now to separate documentation from different backends. (concat "\n" (propertize "\n" 'face '(:inherit separator-line :extend t)) "\n") I've mailed Jason Blevins, markdown.el maintainer but he hasn't responded. Maybe make a bug report in the Github repo. But window-width independence doesn't end there. A proper renderer would probably remove hard new lines in markdown paragraphs, so that text can be wrapped automatically to windows with visual-line-mode does. Or another way to get the same effect. >> 4. Make a new Markdown mode based on a tree-sitter grammar > > I think a simple mode just to view a markdown document would be useful. > However, tree-sitter only helps parse a document. Turning an abstract > syntax tree into a viewable Emacs buffer is still a substantial work, I > suppose. You're right, but one has to start somewhere... Or not. Maybe a couple of patches to markdown.el and a gfm-render-mode with no hard newlines in paragraphs (presuming markdown.el knows where paragraphs live) is the shortest path to victory? Jo=C3=A3o