Skip to content

md-ts-mode autoload overrides global markdown-mode (breaks Doom Emacs keybindings) #155

@junghan0611

Description

@junghan0611

Problem

md-ts-mode.el registers ;;;###autoload cookies on auto-mode-alist and treesit-major-mode-remap-alist (lines 1253-1258):

;;;###autoload
(add-to-list 'auto-mode-alist '("\\.md\\'" . md-ts-mode-maybe))
;;;###autoload
(when (boundp 'treesit-major-mode-remap-alist)
  (add-to-list 'treesit-major-mode-remap-alist
               '(markdown-mode . md-ts-mode)))

This causes all .md files to open in md-ts-mode globally, even though only pi-coding-agent-chat-mode needs it.

Impact

In Doom Emacs (and likely other frameworks with markdown-mode customizations):

  • markdown-mode-map keybindings (localleader: insert headings, bold, links, etc.) are lost
  • evil-markdown-mode hook doesn't fire (md-ts-mode derives from text-mode, not markdown-mode)
  • Affects all users who install the package, with no opt-in

Suggestion

Remove the ;;;###autoload cookies from the auto-mode-alist and treesit-major-mode-remap-alist forms. pi-coding-agent already does (require 'md-ts-mode) internally, so the global registration is unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions