Eli Zaretskii writes: >> From: Matthias Meulien >> Cc: emacs-devel >> Date: Mon, 03 Oct 2022 20:07:44 +0200 >> >> I also cloned tree-sitter-python but I've no idea of what should be done >> with the grammar file. I've understood that I am suppposed to convert >> the grammar to a shared object but I don't know how... >> >> (I've tree-sitter-cli installed and in path, but "tree-sitter generate >> tree-sitter-python/grammar.js" seems to generate rust and node bindings; >> Am I supposed to compile the src/parser.c file? I don't see any >> Makefile...). > > Some of these lack the Makefile. But the Makefile is standard and can > be taken from any other language module, for example I see on in > tree-sitter-ruby. So just clone that as well, copy its Makefile into > tree-sitter-python, and run "make". Thank you, Eli. It wasn't as easy as you said but I managed to compile a shared object using a modified version of the Makefile found in the tree-sitter-ruby (using the file as is fails when building tree-sitter-{ruby,python} due to a missing -Wl, before -soname usage). At first sight, moving commands and imenu seems to work as expected. Fontification too. I saw small differences between buffers fontified with `python-use-tree-sitter' equal to nil and t. Attached is a screenshot where one can see two such differences (the third tall buffer shows the output of "tree-sitter highlight"): - line 284: The self attribute - line 296: The variable in the f-string