As of 2026-04-22, the tree-sitter in the Arch Linux repositories is not compatible with the emacs in the Arch Linx repositories. Specifically, the tree-sitter is too new for Emacs 30.2. I couldn’t find anything else online about this so I’m fixing the problem.

  1. Uninstall emacs, make sure tree-sitter goes with it.
  2. Download tree-sitter-0.24.7-1-x86_64.pkg.tar.zst from the Arch Linux Archive
  3. Install it manually: sudo pacman -U tree-sitter-0.24.7-1-x86_64.pkg.tar.zst
  4. Add tree-sitter to IgnorePkg in /etc/pacman.conf.
  5. Install emacs from source (go to the GNU website; download a tarball; extract; ./autogen.sh; ./configure; make sure it says Does Emacs use -ltree-sitter? yes; make -j16; sudo make install).
  6. Use tree-sitter grammars at a suitably old version. This diverges based on your setup. I use casouri’s helper, so after cloning that repo, I need to apply the following patch:

        diff --git a/build.sh b/build.sh
        index b0920fb..ab70e13 100755
        --- a/build.sh
        +++ b/build.sh
        @@ -151,6 +151,9 @@ case "${lang}" in
        "proto")
        org="mitchellh"
        ;;
        +    "rust")
        +        version="v0.21.2"
        +        ;;
        "scss")
        org="tree-sitter-grammars"
        ;;
    
  7. Then, run JOBS=16 ./batch.sh and cp dist/* ../tree-sitter.
  8. Open a random Rust file to check that it’s all working properly. If you have syntax highlighting, it works.