treesit-auto icon indicating copy to clipboard operation
treesit-auto copied to clipboard

RFI: how to specify the destination directory for new installs

Open rileyrg opened this issue 2 years ago • 2 comments

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))

rileyrg avatar Jan 10 '24 12:01 rileyrg

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?

renzmann avatar Feb 23 '24 15:02 renzmann

Can you please point me in the right direction on how to write that advice? I have 0 elisp skills :)

Also, is adding an optional argument a breaking change in elisp?

jvillasante avatar Aug 30 '24 12:08 jvillasante