renzmann / treesit-auto

Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29
GNU General Public License v3.0
353 stars 27 forks source link

RFI: how to specify the destination directory for new installs #79

Open rileyrg opened 6 months ago

rileyrg commented 6 months ago

I use the no-litter package and I while I successfully pick up grammars in my var/tree-sitter directory care of the additional paths value, the auto install seems to insist on installing new ones into .emacs.d/tree-sitter. Am I missing a config to allow me to point to my var/tree-sitter directory? If not, would it please be possible? I just hate having third party data in my .emacs.d top level ;)

  (use-package treesit-auto
    :custom
    (treesit-auto-install 'prompt)
    (treesit-extra-load-path `(,(no-littering-expand-var-file-name "tree-sitter")))
    :config
    (treesit-auto-add-to-auto-mode-alist 'all)
    (global-treesit-auto-mode))
renzmann commented 4 months ago

It looks like newer versions of Emacs will allow you to do this. In Emacs 29 the output directory was hard-coded.

Since I need to maintain compatibility with Emacs 29, I don't have a ton of motivation to add a configuration at the treesit-auto level. Maybe just advising the treesit-install-language-grammar with that output directory would work for you?