mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Make tree-sitter based modes optional
* lisp/progmodes/c-ts-mode.el: Update Commentary. Make 'auto-mode-alist' update conditional on the tree-sitter and grammar libraries being available. * lisp/progmodes/cmake-ts-mode.el: * lisp/progmodes/csharp-mode.el: * lisp/progmodes/dockerfile-ts-mode.el: * lisp/progmodes/go-ts-mode.el: * lisp/progmodes/java-ts-mode.el: * lisp/progmodes/js.el: * lisp/progmodes/json-ts-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-ts-mode.el: * lisp/progmodes/typescript-ts-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/toml-ts-mode.el: * lisp/textmodes/yaml-ts-mode.el: Make 'auto-mode-alist' update for tree-sitter based modes be conditional on the tree-sitter and grammar libraries being available. (Bug#60559)
This commit is contained in:
parent
b56cf28b32
commit
6b2f85caa6
16 changed files with 140 additions and 76 deletions
|
|
@ -117,9 +117,6 @@
|
|||
'((ERROR) @font-lock-warning-face))
|
||||
"Tree-sitter font-lock settings for `yaml-ts-mode'.")
|
||||
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("\\.ya?ml\\'" . yaml-ts-mode))
|
||||
|
||||
;;;###autoload
|
||||
(define-derived-mode yaml-ts-mode text-mode "YAML"
|
||||
"Major mode for editing YAML, powered by tree-sitter."
|
||||
|
|
@ -146,6 +143,9 @@
|
|||
|
||||
(treesit-major-mode-setup)))
|
||||
|
||||
(if (treesit-ready-p 'yaml)
|
||||
(add-to-list 'auto-mode-alist '("\\.ya?ml\\'" . yaml-ts-mode)))
|
||||
|
||||
(provide 'yaml-ts-mode)
|
||||
|
||||
;;; yaml-ts-mode.el ends here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue