chore(language/toml): don't install conf-toml-mode if toml-ts-mode is available

This commit is contained in:
2024-05-26 23:57:03 +01:00
parent eec29b6c55
commit fe47210ec8

View File

@@ -8,21 +8,21 @@
(require 'siren-prog-mode)
(use-package conf-toml-mode
:straight (:type built-in)
:mode "\\.toml\\'" "Cargo\\.lock\\'"
:hook (conf-toml-mode . siren-toml-mode-setup))
;; Requires Emacs 29.x or later for built-in treesit support.
(when (fboundp 'toml-ts-mode)
(require 'siren-treesit)
(if (fboundp 'toml-ts-mode)
(use-package toml-ts-mode
:straight (:type built-in)
:mode "\\.toml\\'" "Cargo\\.lock\\'"
:hook
(toml-ts-mode . siren-toml-mode-setup)
:preface
(require 'siren-treesit)
:config
(siren-treesit-auto-ensure-grammar 'toml)))
(siren-treesit-auto-ensure-grammar 'toml))
(use-package conf-toml-mode
:straight (:type built-in)
:mode "\\.toml\\'" "Cargo\\.lock\\'"
:hook (conf-toml-mode . siren-toml-mode-setup)))
(defun siren-toml-mode-setup ()
"Default tweaks for `toml-mode'."