Skip to content

Do not let the vendored md-ts-mode claim Markdown files globally#157

Merged
dnouri merged 1 commit intomasterfrom
fix-155-no-global-md-registration
Mar 7, 2026
Merged

Do not let the vendored md-ts-mode claim Markdown files globally#157
dnouri merged 1 commit intomasterfrom
fix-155-no-global-md-registration

Conversation

@dnouri
Copy link
Owner

@dnouri dnouri commented Mar 7, 2026

pi-coding-agent uses the vendored md-ts-mode as an internal rendering engine for chat buffers. When that file registers itself in auto-mode-alist and treesit-major-mode-remap-alist, merely loading pi-coding-agent changes how unrelated Markdown files open throughout Emacs. That breaks user expectations and interferes with configurations that rely on markdown-mode hooks and keymaps.

Remove those global registrations from the vendored copy, clarify that md-ts-mode opt-in remains explicit, and strengthen regression coverage. The tests now verify both loading the vendored mode itself and loading pi-coding-agent leave Markdown file associations untouched. A shared batch-Emacs test helper initializes packages before evaluation so the package-load regression test exercises the real loading path.

See: #155

pi-coding-agent uses the vendored md-ts-mode as an internal rendering engine for chat buffers. When that file registers itself in auto-mode-alist and treesit-major-mode-remap-alist, merely loading pi-coding-agent changes how unrelated Markdown files open throughout Emacs. That breaks user expectations and interferes with configurations that rely on markdown-mode hooks and keymaps.

Remove those global registrations from the vendored copy, clarify that md-ts-mode opt-in remains explicit, and strengthen regression coverage. The tests now verify both loading the vendored mode itself and loading pi-coding-agent leave Markdown file associations untouched. A shared batch-Emacs test helper initializes packages before evaluation so the package-load regression test exercises the real loading path.

See: #155
@dnouri dnouri force-pushed the fix-155-no-global-md-registration branch from 7945dad to 741fe78 Compare March 7, 2026 22:46
@dnouri dnouri merged commit 5a4e33a into master Mar 7, 2026
9 checks passed
@dnouri dnouri deleted the fix-155-no-global-md-registration branch March 7, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant