GNU bug report logs -
#77856
31.0.50; Add markdown-ts-mode support to eglot/eldoc
Previous Next
To reply to this bug, email your comments to 77856 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Thu, 17 Apr 2025 00:09:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Rahul Martim Juliato <rahuljuliato <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 17 Apr 2025 00:09:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi all,
I'm opening this as a feature request rather than a bug report.
Now that `markdown-ts-mode` is available on `master`, and with some
exciting developments on the horizon (see:
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00581.html), I
wanted to propose a potential improvement to `eglot`.
Currently, I’ve been experimenting with a small hack to enable proper
highlighting and formatting in the eldoc buffer when using language
servers that return Markdown documentation. By explicitly setting the
eldoc buffer to `markdown-ts-mode`, the results are quite promising.
Instead of relying on this workaround, would it be possible to support
`markdown-ts-mode` (or optionally `gfm-view-mode`) within
`eglot--format-markup` directly? This could be an opt-in feature for
users who prefer either mode for viewing Markdown content.
It might still be a bit early, but I believe integrating this kind of
support would further enhance the experience that Eglot already
provides.
Thanks for considering!
--
Rahul M. Juliato
In GNU Emacs 31.0.50 (build 6, aarch64-apple-darwin24.4.0, NS
appkit-2575.50 Version 15.4 (Build 24E248)) of 2025-04-16 built on
MacBook-Pro.local
Repository revision: 2330e7b6d676761b60c3247f53224815512a9a58
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2575
System Description: macOS 15.4
Configured using:
'configure --with-mailutils --with-imagemagick --with-ns'
Configured features:
ACL GNUTLS IMAGEMAGICK LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER
PNG SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP ZLIB
Important settings:
value of $LANG: pt_BR.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
display-line-numbers-mode: t
flymake-mode: t
icomplete-vertical-mode: t
icomplete-mode: t
electric-pair-mode: t
which-key-mode: t
minibuffer-electric-default-mode: t
minibuffer-depth-indicate-mode: t
xterm-mouse-mode: t
winner-mode: t
save-place-mode: t
savehist-mode: t
repeat-mode: t
recentf-mode: t
global-auto-revert-mode: t
pixel-scroll-precision-mode: t
delete-selection-mode: t
override-global-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort emacsbug mail-extr org-timer org-colview org-clock
org-attach org-archive org-agenda org-element org-persist org-id
org-element-ast inline avl-tree generator org-refile ol-eww eww vtable
url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect
gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr
pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start
gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo
gnus-spec gnus-int gnus-range message sendmail yank-media puny rfc822
mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
gmm-utils mailheader gnus-win ol-docview doc-view jka-compr image-mode
exif dired dired-loaddefs ol-bibtex bibtex ol-bbdb ol-w3m ol-doi
org-link-doi reporter org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-src sh-script smie treesit executable ob-comint
org-pcomplete pcomplete org-list org-footnote org-faces org-entities
org-version ob-emacs-lisp ob-core ob-eval org-cycle org-table ol
org-fold org-fold-core org-keys oc org-loaddefs cal-menu calendar
cal-loaddefs org-compat org-macs .gnus noutline outline vc-git files-x
vc-dispatcher cursor-sensor display-line-numbers eglot
external-completion jsonrpc xref diff diff-mode track-changes ert ewoc
debug backtrace find-func imenu checkdoc lisp-mnt flymake warnings
thingatpt private icomplete elec-pair which-key init project transient
format-spec pcase rx finder-inf package browse-url xdg url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
url-vars modus-vivendi-tinted-theme modus-themes minibuf-eldef mb-depth
gnus nnheader gnus-util mail-utils range mm-util mail-prsvr rcirc
parse-time iso8601 auth-source eieio eieio-core password-cache json map
time-date disp-table time xt-mouse winner cus-edit pp icons saveplace
savehist repeat recentf tree-widget wid-edit autorevert filenotify grep
compile text-property-search comint ansi-osc ansi-color pixel-scroll
cua-base ring subr-x delsel cus-load edmacro kmacro byte-opt cl-macs gv
cl-extra help-mode use-package-bind-key bind-key easy-mmode
use-package-ensure cl-seq use-package-core cl-loaddefs cl-lib bytecomp
byte-compile early-init rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads kqueue cocoa ns lcms2
multi-tty make-network-process tty-child-frames emacs)
Memory information:
((conses 16 377829 788989) (symbols 48 32593 252)
(strings 32 98787 30855) (string-bytes 1 2707470) (vectors 16 53986)
(vector-slots 8 502477 234403) (floats 8 381 816)
(intervals 56 3019 287) (buffers 992 14))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Thu, 17 Apr 2025 06:32:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 77856 <at> debbugs.gnu.org (full text, mbox):
> From: Rahul Martim Juliato <rahuljuliato <at> gmail.com>
> Date: Wed, 16 Apr 2025 21:07:48 -0300
>
>
> Hi all,
>
> I'm opening this as a feature request rather than a bug report.
>
> Now that `markdown-ts-mode` is available on `master`, and with some
> exciting developments on the horizon (see:
> https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00581.html), I
> wanted to propose a potential improvement to `eglot`.
>
> Currently, I’ve been experimenting with a small hack to enable proper
> highlighting and formatting in the eldoc buffer when using language
> servers that return Markdown documentation. By explicitly setting the
> eldoc buffer to `markdown-ts-mode`, the results are quite promising.
>
> Instead of relying on this workaround, would it be possible to support
> `markdown-ts-mode` (or optionally `gfm-view-mode`) within
> `eglot--format-markup` directly? This could be an opt-in feature for
> users who prefer either mode for viewing Markdown content.
>
> It might still be a bit early, but I believe integrating this kind of
> support would further enhance the experience that Eglot already
> provides.
>
> Thanks for considering!
Thanks, I'm adding João to this discussion.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Fri, 18 Apr 2025 14:37:06 GMT)
Full text and
rfc822 format available.
Message #11 received at 77856 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Instead of relying on this workaround, would it be possible to support
>> `markdown-ts-mode` (or optionally `gfm-view-mode`) within
>> `eglot--format-markup` directly? This could be an opt-in feature for
>> users who prefer either mode for viewing Markdown content.
I'm interested in adding markdown-ts-mode support to Eglot (not only to
the Eglot->Eldoc interface but potentially also to the Eglot->Company
interface).
So a patch is welcome. There is already a customization option
eglot-prefer-plaintext so no additional opt-in/out logic is required or
desired. If that variable is nil the order should be:
-> Use markdown-ts-mode if it is available.
-> Use markdown-mode.el's gfm-view-mode if it is available
-> Go with plaintext as is done down.
It's important to keep in mind that Eglot works in Emacs versions as far
back as 26.3 and it should stay that way unless there's good reason to
break it.
An fboundp check should be enough. The change is easiest if you first
replace all eglot.el's use of `gfm-view-mode' with an argless call to a
new symbol-returning helper function called
eglot--markdown-renderer-mode, for example.
An etc/EGLOT-NEWS entry should accompany the change.
>> Thanks for considering!
Good luck and thanks in advance!
João
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Tue, 22 Apr 2025 23:55:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 77856 <at> debbugs.gnu.org (full text, mbox):
João Távora <joaotavora <at> gmail.com> writes:
> I'm interested in adding markdown-ts-mode support to Eglot (not only to
> the Eglot->Eldoc interface but potentially also to the Eglot->Company
> interface).
>
> So a patch is welcome. There is already a customization option
> eglot-prefer-plaintext so no additional opt-in/out logic is required or
> desired. If that variable is nil the order should be:
>
Thanks for your support João!
I'm gently and slowly tapping into it.
I noticed some recent changes on flymake and eglot though, It looks like
Eldoc started failing me when using it with Eglot.
To reproduce:
Create a =test.ts= file with the content:
#+BEGIN_SRC typescript
const xxx = 1 ++ 2;
#+END_SRC
Start Emacs compiled from master with:
#+BEGIN_SRC bash
emacs -Q test.ts \
--eval "(progn \
(typescript-ts-mode) \
(setq flymake-show-diagnostics-at-end-of-line t) \
(eglot-ensure))"
#+END_SRC
Both 1 and 2 are correctly marked with errors, the flymake inline
diagnostic also correctly prints the error inside the buffer.
Problem is that when I position my cursor over the error, or try to run
=flymake-show-buffer-diagnostics=, I always get an error like:
#+BEGIN_SRC bash
flymake--tabulated-setup-1: Wrong type argument: listp, 2357
eldoc error: (wrong-type-argument sequencep 2357)
#+END_SRC
This wasn't the case with my last week build, where eldoc was properly
showing documentation.
--
Rahul Martim Juliato
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Wed, 23 Apr 2025 07:41:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 77856 <at> debbugs.gnu.org (full text, mbox):
Rahul Martim Juliato <rahuljuliato <at> gmail.com> writes:
> João Távora <joaotavora <at> gmail.com> writes:
> I noticed some recent changes on flymake and eglot though, It looks like
> Eldoc started failing me when using it with Eglot.
It's a bit off-topic here, but thanks for the report. I managed to
reproduce and fix in master. Flymake 1.4.1 in package version (should
be available from GNU ELPA in about a day or so) will also have the fix.
João
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sat, 26 Apr 2025 13:24:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Rahul Martim Juliato <rahuljuliato <at> gmail.com>
:
bug acknowledged by developer.
(Sat, 26 Apr 2025 13:24:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 77856-done <at> debbugs.gnu.org (full text, mbox):
> From: João Távora <joaotavora <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 77856 <at> debbugs.gnu.org
> Date: Wed, 23 Apr 2025 08:41:03 +0100
>
> Rahul Martim Juliato <rahuljuliato <at> gmail.com> writes:
>
> > João Távora <joaotavora <at> gmail.com> writes:
>
> > I noticed some recent changes on flymake and eglot though, It looks like
> > Eldoc started failing me when using it with Eglot.
>
> It's a bit off-topic here, but thanks for the report. I managed to
> reproduce and fix in master. Flymake 1.4.1 in package version (should
> be available from GNU ELPA in about a day or so) will also have the fix.
Thanks, closing.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Sat, 26 Apr 2025 15:00:03 GMT)
Full text and
rfc822 format available.
Message #25 received at 77856-done <at> debbugs.gnu.org (full text, mbox):
On Sat, Apr 26, 2025 at 2:23 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: João Távora <joaotavora <at> gmail.com>
> > Cc: Eli Zaretskii <eliz <at> gnu.org>, 77856 <at> debbugs.gnu.org
> > Date: Wed, 23 Apr 2025 08:41:03 +0100
> >
> > Rahul Martim Juliato <rahuljuliato <at> gmail.com> writes:
> >
> > > João Távora <joaotavora <at> gmail.com> writes:
> >
> > > I noticed some recent changes on flymake and eglot though, It looks like
> > > Eldoc started failing me when using it with Eglot.
> >
> > It's a bit off-topic here, but thanks for the report. I managed to
> > reproduce and fix in master. Flymake 1.4.1 in package version (should
> > be available from GNU ELPA in about a day or so) will also have the fix.
>
> Thanks, closing.
I don't know if you should be closing this, bcause this bug is about
adding markdown-ts-mode
support to Eglot, which is not done. It's just that Rahul decided to
use this thread
to report an unrelated bug here in this thread, which I fixed. But I
didn't add
markdown-ts-mode to Eglot. When that happens, that's when the bug
should be closed.
João
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Sat, 26 Apr 2025 15:11:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 77856 <at> debbugs.gnu.org (full text, mbox):
> From: João Távora <joaotavora <at> gmail.com>
> Date: Sat, 26 Apr 2025 15:59:50 +0100
> Cc: rahuljuliato <at> gmail.com, 77856-done <at> debbugs.gnu.org
>
> On Sat, Apr 26, 2025 at 2:23 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > > From: João Távora <joaotavora <at> gmail.com>
> > > Cc: Eli Zaretskii <eliz <at> gnu.org>, 77856 <at> debbugs.gnu.org
> > > Date: Wed, 23 Apr 2025 08:41:03 +0100
> > >
> > > Rahul Martim Juliato <rahuljuliato <at> gmail.com> writes:
> > >
> > > > João Távora <joaotavora <at> gmail.com> writes:
> > >
> > > > I noticed some recent changes on flymake and eglot though, It looks like
> > > > Eldoc started failing me when using it with Eglot.
> > >
> > > It's a bit off-topic here, but thanks for the report. I managed to
> > > reproduce and fix in master. Flymake 1.4.1 in package version (should
> > > be available from GNU ELPA in about a day or so) will also have the fix.
> >
> > Thanks, closing.
>
> I don't know if you should be closing this, bcause this bug is about
> adding markdown-ts-mode
> support to Eglot, which is not done. It's just that Rahul decided to
> use this thread
> to report an unrelated bug here in this thread, which I fixed. But I
> didn't add
> markdown-ts-mode to Eglot. When that happens, that's when the bug
> should be closed.
Sorry about my misunderstanding. Feel free to reopen the bug.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Sat, 26 Apr 2025 21:01:03 GMT)
Full text and
rfc822 format available.
Message #31 received at 77856 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: João Távora <joaotavora <at> gmail.com>
>> Date: Sat, 26 Apr 2025 15:59:50 +0100
>> Cc: rahuljuliato <at> gmail.com, 77856-done <at> debbugs.gnu.org
>>
>> On Sat, Apr 26, 2025 at 2:23 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>> >
>> > > From: João Távora <joaotavora <at> gmail.com>
>> > > Cc: Eli Zaretskii <eliz <at> gnu.org>, 77856 <at> debbugs.gnu.org
>> > > Date: Wed, 23 Apr 2025 08:41:03 +0100
>> > >
>> > > Rahul Martim Juliato <rahuljuliato <at> gmail.com> writes:
>> > >
>> > > > João Távora <joaotavora <at> gmail.com> writes:
>> > >
>> > > > I noticed some recent changes on flymake and eglot though, It looks like
>> > > > Eldoc started failing me when using it with Eglot.
>> > >
>> > > It's a bit off-topic here, but thanks for the report. I managed to
>> > > reproduce and fix in master. Flymake 1.4.1 in package version (should
>> > > be available from GNU ELPA in about a day or so) will also have the fix.
>> >
>> > Thanks, closing.
>>
>> I don't know if you should be closing this, bcause this bug is about
>> adding markdown-ts-mode
>> support to Eglot, which is not done. It's just that Rahul decided to
>> use this thread
>> to report an unrelated bug here in this thread, which I fixed. But I
>> didn't add
>> markdown-ts-mode to Eglot. When that happens, that's when the bug
>> should be closed.
>
> Sorry about my misunderstanding. Feel free to reopen the bug.
My bad!
I mixed two subjects in a single bug thread:
- **Feature request**: to add Markdown support (which should probably
still be open).
- **Bug**: I found this while trying to implement a prototype version of
the first subject (this caused the confusion — I should have opened
a separate thread for it. Thankfully, João was lightning fast and
already solved it).
Sorry again!
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Sat, 26 Apr 2025 22:33:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 77856 <at> debbugs.gnu.org (full text, mbox):
reopen 77856
thanks
> Sorry about my misunderstanding. Feel free to reopen the bug.
Let's hope I managed to do that with the above commands.
Did not alter fixed versions and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 26 Apr 2025 22:33:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77856
; Package
emacs
.
(Sun, 27 Apr 2025 05:50:02 GMT)
Full text and
rfc822 format available.
Message #39 received at 77856 <at> debbugs.gnu.org (full text, mbox):
> From: João Távora <joaotavora <at> gmail.com>
> Date: Sat, 26 Apr 2025 23:32:46 +0100
> Cc: rahuljuliato <at> gmail.com, 77856 <at> debbugs.gnu.org
>
> reopen 77856
> thanks
>
> > Sorry about my misunderstanding. Feel free to reopen the bug.
>
> Let's hope I managed to do that with the above commands.
You did.
This bug report was last modified 50 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.