all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Wei-Ting Lin <linwaytin@gmail.com>
Cc: 61072@debbugs.gnu.org, jblevins@xbeta.org
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	[thread overview]
Message-ID: <87zg83cey9.fsf@gmail.com> (raw)
In-Reply-To: <CAKWBqSYMQEdSdB86Ba_G5WYfxvGrnE4pC2V8b9NEfzDzAA8Keg@mail.gmail.com> (Wei-Ting Lin's message of "Wed, 25 Jan 2023 20:42:26 -0500")

Wei-Ting Lin <linwaytin@gmail.com> writes:

> As seen in the screenshot, the line is too long for the child frame and gets wrapped. How can I change the length of the
> line?

> This issue was posted in https://github.com/joaotavora/eglot/discussions/1157 originally. 

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ão





      parent reply	other threads:[~2023-03-23 21:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26  1:42 bug#61072: How to change the length of the separation lines in eldoc, used by eglot? Wei-Ting Lin
2023-01-26 11:12 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-27  1:08   ` Wei-Ting Lin
2023-02-09 17:05 ` Felician Nemeth
2023-02-18 15:08   ` Wei-Ting Lin
2023-02-21 17:11     ` Felician Nemeth
2023-02-21 17:19       ` João Távora
2023-03-15 12:07         ` Felician Nemeth
2023-03-23 21:59           ` João Távora
2023-03-28 15:16             ` Felician Nemeth
2023-03-28 22:27               ` João Távora
2023-03-29 17:48                 ` Felician Nemeth
2023-03-29 23:59                   ` Yuan Fu
2023-04-08  8:52                     ` Felician Nemeth
2023-04-08  9:10                       ` João Távora
2023-03-23 21:53 ` João Távora [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg83cey9.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=61072@debbugs.gnu.org \
    --cc=jblevins@xbeta.org \
    --cc=linwaytin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.