Subject: 31.0.50; Add markdown-ts-mode support to eglot/eldoc

From: Rahul Martim Juliato <[email-masked]>
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!

--
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))