Closed blahgeek closed 1 year ago
Update: I reported this to emacs and got a reply: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63463 so apparently that behavior is intended and markdown-mode
should not call treesit-based major modes.
How about https://github.com/jrblevin/markdown-mode/commit/f40808f7d1e012a885062ac6b2fa82e5e14d1e14 ?
Load the language mode only if user sets it in auto-mode-alist
.
Look good, thank you for your work!
In emacs 29, when
markdown-get-lang-mode
selects apython-ts-mode
for python, it would also enable it globally for all *.py files.Steps to produce:
Expected behavior: The xxx.py file is opened with
python-mode
major mode (which is the default)Actual behavior: The xxx.py file is opened with
python-ts-mode
.The reason is that, in emacs 29, running
python-ts-mode
even for single buffer would modifyauto-mode-alist
globally: https://github.com/emacs-mirror/emacs/blob/ba2c76fa2bc3aabfda7d1d09cc5148f3f9d8e08e/lisp/progmodes/python.el#L6751This is also true for almost all other treesit based major modes.
(I think this is a bug in the emacs core. I would file a bug report there too.)