renzmann / treesit-auto

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

[fix] Honor `global-treesit-auto-modes` #46

Closed domq closed 6 months ago

domq commented 1 year ago

Fixes #35

In treesit-auto--set-major-remap, bail if the major mode we are switching to is not part of global-treesit-auto-modes. The latter is a variable that was already declared, kind of by mistake, as part of the call to define-globalized-minor-mode.

Here is how to configure treesit-auto to apply to bash only:

(use-package treesit-auto
  :config
  (setq treesit-auto-langs '(bash)
        treesit-auto-install t
        global-treesit-auto-modes '(sh-mode))
  (global-treesit-auto-mode))
domq commented 1 year ago

Now with an implementation that honors the (not) forms.

renzmann commented 9 months ago

I think this was solved by #63 ? If so, I'll vote to close this one out. In the end we opted for treesit-auto-langs instead of modifying the global-treesit-auto-modes, but I'm pretty sure the end behavior is the same.

domq commented 6 months ago

Thanks for providing #63! I tested it successfully, and I'm therefore withdrawing #46.