Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting (global-tree-sitter-mode) in config.el causes warning on Emacs startup #286

Open
mayersj1 opened this issue Jun 24, 2024 · 1 comment

Comments

@mayersj1
Copy link

Adding (global-tree-sitter-mode) in my config.el causes the following warning to be thrown:

error No language registered for major mode 'fundamental-mode'

Shouldn't this just be a no-op for fundamental-mode. The entire purpose of (global-tree-sitter-mode) is so that I don't need to add my own hooks for each and every mode.

@offbyone
Copy link

For me it actually breaks startup; I'm using the doom emacs configuration, with fold enabled. fold triggers (ts-fold-mode +1) which triggers a tree-sitter--handle-dependent macro. That macro runs this:

         (progn
           (tree-sitter--error-protect
               ;; Make sure `tree-sitter-mode' is enabled before MODE.
               (progn
                 (unless tree-sitter-mode
                   (tree-sitter-mode))
                 ,setup)
             ;; Setup failed. Clean things up, leave no trace.
             (setq ,mode nil)
             ,teardown) ...

For whatever reason, this unwind-protect isn't working; running doom with fold and tree-sitter enabled results in an init error, and running it with --debug-init gives me the trace that led me here.

Doom is 3.0.0-pre
tree-sitter-mode is at 02fe7b8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants