]> git.eshelyaron.com Git - emacs.git/commit
New tree-sitter toggle scheme
authorYuan Fu <casouri@gmail.com>
Tue, 25 Oct 2022 20:54:12 +0000 (13:54 -0700)
committerYuan Fu <casouri@gmail.com>
Tue, 25 Oct 2022 21:07:47 +0000 (14:07 -0700)
commit7c5d4348330b206aff1f8e5bc4fd241d6a6dc0b5
tree8e945b0380e34d86d3206f44980e5bf80f0b298c
parent06b5ec4bbde119d14d866fc3713a4ed390d531f2
New tree-sitter toggle scheme

This version: central variable, everything controlled by
treesit-settings.  Major mode sets up tree-sitter/non-tree-sitter
in a conditional branch, based on the setting.

* lisp/treesit.el (treesit-settings): New option.
(treesit-defun-type-regexp): Change docstring.
(treesit-mode-supported)
(treesit-required-languages)
(treesit--local-variable-backup): Remove variables.
(treesit--backup-local-variable)
(treesit-mode)
(global-treesit-mode--turn-on)
(global-treesit-mode): Remove functions.
(treesit--setting-for-mode): New function.
(treesit-ready-p): New argument MODE, changed REPORT to QUIET, and
LANGUAGEs to LANGUAGE (now it can be a single symbol or a list of
them).
(treesit-major-mode-setup): New function.  Mostly comes from
treesit-mode.

* test/src/treesit-tests.el (treesit-misc): New test.

* lisp/progmodes/python.el (python-mode): Move some setup code into
the conditional branch at the end.

* lisp/progmodes/js.el (js-json-mode)
(js-mode): Move some setup code into the conditional branch at the
end.

* lisp/progmodes/ts-mode.el: Move tree-sitter setup into the
conditional branch.
lisp/progmodes/js.el
lisp/progmodes/python.el
lisp/progmodes/ts-mode.el
lisp/treesit.el
test/src/treesit-tests.el