Thanks Eli and Jostein! No problem criticising :) Please find a new patch attached. Things I've made: - changed the file to the textmodes folder - made it inherit from `text-mode' - changed the news with +++ - changed `emacs.texi' (is it here?) to add Markdown - scratched my head until 2:30AM thinking why it would not work for Jostein test. Well Jostein, I've been played by the tree-sitter github repository maintainer, lol. First, a little note. There's actually no major changes to the version on github. I only changed documenting strings and made some small name changes to more "alike" already existing modes. It happens that on tree-sitter repository, unlike any other of their repositories (that I've seen), "main" branch is NOT the current branch, but the "we moved from here bye" one. The current default branch is "split_parser" where tree-sitter-markdown/src/ resides, hence the confusion. So, I wrote the mode with the "main" one in mind. I already checked the "new" (split_parser) one, and it seems it is possible to convert the current work to use this one instead. I'll try to do this in the middle of the week or sooner :) In the mean time, I realized more people would like to test this patch and tree-sitter setup is really trick, so I made this little "guide" on how to apply it until the end result (this might work now, pointing to the "main" branch with the current patch). If you could please try the path (B) on the guide and tell me if this works for you, It would be nice, Jostein. Thanks! Rahul --- beggining of guide on how to apply this patch and test it Git apply this patch. Run the autogen script: ./autogen.sh Make sure configure uses tree-sitter: ./configure --with-tree-sitter Compile: make bootstrap Check the build: ./src/emacs -Q --version Open emacs ./src/emacs -Q --init-dir=~/tmp_emacs_dir/ A) The Hard Way Visit a .md file C-x f TEST.md Note the mode will not automatically load. This behavior is the same as typescript-ts-mode or other treesitter modes I've been using. M-x markdown-ts-mode It will fail since you have no tree sitter grammar installed. and will suggest installing it with `treesit-install-language-grammar'. This behaviour is also standard for the tree-sitter modes I currently use (typescript, tsx, rust). Issuing "M-x treesit-install-language-grammar RET". It asks for language, complete with "markdown RET". It says there's no recipie for it, if you want to build it interactivelly. Anwser "yes". It asks for the URL where the grammar is hosted, enter: "https://github.com/tree-sitter-grammars/tree-sitter-markdown RET" It asks for the tag or branch, setting the default, enter "main RET". It asks for the subfolder, leave the default (src), enter "RET". It asks for the C compiler to use (default: auto-detect), just "RET". It asks for the C++ compiler to use (default: auto-detect), just "RET". Install to (default "~/tmp_emacs_dir/treesitter"), just "RET". It will clone the repository, compile the library and tell in the minibuffer the library is installed to your folder. B) The Easier Way. Copy-paste and eval this use-package definition. (use-package markdown-ts-mode :mode ("\\.md\\'" . markdown-ts-mode) :defer 't :config (add-to-list 'treesit-language-source-alist '(markdown "https://github.com/tree-sitter-grammars/tree-sitter-markdown" "main" "src"))) Visit your markdown test file. It will probably fail due to the missing grammar. Issue "M-x treesit-install-language-grammar RET". Now with TAB it should complete "markdown", if not, type it. As we already have the source now defined, just hit "RET" to install to the default treemacs folder. It will clone the repository and say it installed on your folder. Just reload the mode with "M-x markdown-ts-mode". From now on (with the use-package definition on `init.el') you should just open .md and have the highlight and stuff. --- end of the guide