Fix uses of treesit-ready-p

* lisp/progmodes/c-ts-mode.el (c-ts-mode)
(c++-ts-mode)
* lisp/progmodes/java-ts-mode.el (java-ts-mode)
* lisp/progmodes/js.el (js-ts-mode)
* lisp/progmodes/json-ts-mode.el (json-ts-mode)
* lisp/progmodes/python.el (python-ts-mode)
* lisp/progmodes/sh-script.el (sh-mode)
* lisp/progmodes/ts-mode.el (ts-mode): Remove the MODE argument.
This commit is contained in:
Yuan Fu 2022-11-19 18:58:12 -08:00
parent f17ca55a0a
commit 4fa13b2d83
No known key found for this signature in database
GPG key ID: 56E19BC57664A442
7 changed files with 8 additions and 8 deletions

View file

@ -494,7 +494,7 @@ the subtrees."
"Major mode for editing C, powered by tree-sitter."
:group 'c
(unless (treesit-ready-p nil 'c)
(unless (treesit-ready-p 'c)
(error "Tree-sitter for C isn't available"))
(treesit-parser-create 'c)
@ -519,7 +519,7 @@ the subtrees."
"Major mode for editing C++, powered by tree-sitter."
:group 'c++
(unless (treesit-ready-p nil 'cpp)
(unless (treesit-ready-p 'cpp)
(error "Tree-sitter for C++ isn't available"))
;; Comments.

View file

@ -277,7 +277,7 @@ the subtrees."
:group 'java
:syntax-table java-ts-mode--syntax-table
(unless (treesit-ready-p nil 'java)
(unless (treesit-ready-p 'java)
(error "Tree-sitter for Java isn't available"))
(treesit-parser-create 'java)

View file

@ -3799,7 +3799,7 @@ Currently there are `js-mode' and `js-ts-mode'."
\\<js-ts-mode-map>"
:group 'js
(when (treesit-ready-p 'js-mode 'javascript)
(when (treesit-ready-p 'javascript)
;; Borrowed from `js-mode'.
(setq-local prettify-symbols-alist js--prettify-symbols-alist)
(setq-local parse-sexp-ignore-comments t)

View file

@ -124,7 +124,7 @@ the subtrees."
:group 'json
:syntax-table json-ts-mode--syntax-table
(unless (treesit-ready-p nil 'json)
(unless (treesit-ready-p 'json)
(error "Tree-sitter for JSON isn't available"))
(treesit-parser-create 'json)

View file

@ -6591,7 +6591,7 @@ implementations: `python-mode' and `python-ts-mode'."
"Major mode for editing Python files, using tree-sitter library.
\\{python-mode-map}"
(when (treesit-ready-p 'python-mode 'python)
(when (treesit-ready-p 'python)
(treesit-parser-create 'python)
(setq-local treesit-font-lock-feature-list
'(( comment string definition)

View file

@ -1587,7 +1587,7 @@ with your script for an edit-interpret-debug cycle."
(cond
;; Tree-sitter. If the shell is bash, we can enable tree-sitter.
((treesit-ready-p 'sh-mode sh-shell)
((treesit-ready-p sh-shell)
(setq-local treesit-font-lock-feature-list
'((comment function string heredoc)
(variable keyword command declaration-command)

View file

@ -267,7 +267,7 @@
(cond
;; `ts-mode' requires tree-sitter to work, so we don't check if
;; user enables tree-sitter for it.
((treesit-ready-p nil 'tsx)
((treesit-ready-p 'tsx)
;; Tree-sitter.
(treesit-parser-create 'tsx)