GNU bug report logs -
#61072
How to change the length of the separation lines in eldoc, used by eglot?
Previous Next
Reported by: Wei-Ting Lin <linwaytin <at> gmail.com>
Date: Thu, 26 Jan 2023 06:49:01 UTC
Severity: normal
Done: João Távora <joaotavora <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Wei-Ting Lin <linwaytin <at> 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
This bug report was last modified 2 years and 104 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.