renzmann / treesit-auto

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

⛔ Error (use-package): treesit-auto/:config: Symbol’s value as variable is void: treesit-language-source-alist #5

Closed dangom closed 1 year ago

dangom commented 1 year ago

Using the config suggested in the README:

(use-package treesit-auto
  :demand t
  :straight (treesit-auto :host github :repo "renzmann/treesit-auto")
  :config
  (add-to-list 'treesit-auto-fallback-alist '(bash-ts-mode . sh-mode))
  (treesit-auto-apply-remap)
  (advice-add 'treesit-install-language-grammar
              :after (lambda (&rest _r) (treesit-auto-apply-remap))))
renzmann commented 1 year ago

Interesting, I'm not able to reproduce it. I don't use straight, so I can't say if it's that part. What's your Emacs version? I've got 29.0.60, compiled at the 7fb69ce233b8a655af63d4c47b7359c43660acf6 commit with the --with-tree-sitter option.

dangom commented 1 year ago

Interesting. Thanks for checking. I'm on the main branch:

In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin20.6.0, NS appkit-2202.70 Version 11.7.1 (Build 20G918)) of 2022-12-15 built on Mac-1671145164440.local Repository revision: 8c84ef128f32b227c7a46cd1da8221b41bd0a370 Repository branch: HEAD Windowing system distributor 'Apple', version 10.3.2299 System Description: macOS 13.1

Configured using: 'configure --with-ns --with-modules '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp:/usr/local/share/emacs/site-lisp' --with-xwidgets --with-tree-sitter --with-native-compilation=aot 'CFLAGS=-I/usr/local/opt/gcc/include -I/usr/local/opt/libgccjit/include -O2' 'LDFLAGS=-L/usr/local/opt/gcc/lib/gcc/12 -L/usr/local/opt/gcc/lib/gcc/12/gcc/x86_64-apple-darwin20/12 -L/usr/local/opt/libgccjit/lib/gcc/12 -I/usr/local/opt/gcc/include -I/usr/local/opt/libgccjit/include -Wl,-headerpad_max_install_names''

I installed Emacs from here: https://github.com/jimeh/emacs-builds

renzmann commented 1 year ago

I also use jimeh's builds for my macbook, though I've just stuck to the emacs-29 ones, so it can't be that. In your lockfile for straight is it pointing to a commit before I added this line? If I had a commit that forgot that require, then I could see it complaining about void variables from treesit

dangom commented 1 year ago

Ok found the issue. The new treesit-language-source-alist variable was added to treesit.el on Dec 30, 2022 at 5:56 AM. My Emacs version is from 2022-12-15, so the variable doesn't exist. I'll update my Emacs and see if the issue is then gone, but I expect it will. Will close the issue then.

renzmann commented 1 year ago

Great, glad it was something simple!

dangom commented 1 year ago

Ok seems fixed. Sorry for the noise. And thanks for the package!