mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
When the global-treesit-auto-mode is enabled, was getting lots of errors related to an infinite loop whenever opening a buffer supported by one of `*-ts-mode` modes. Instead, I now take a more manual and intentional approach to using the built-in treesit modes for specific languages.
34 lines
821 B
EmacsLisp
34 lines
821 B
EmacsLisp
;;; siren-toml.el --- jimeh's Emacs Siren: toml-mode configuration.
|
|
|
|
;;; Commentary:
|
|
|
|
;; Basic configuration for toml-mode.
|
|
|
|
;;; Code:
|
|
|
|
(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)
|
|
(use-package toml-ts-mode
|
|
:straight (:type built-in)
|
|
:mode "\\.toml\\'" "Cargo\\.lock\\'"
|
|
:hook
|
|
(toml-ts-mode . siren-toml-mode-setup)
|
|
:config
|
|
(siren-treesit-auto-ensure-grammar 'toml)))
|
|
|
|
(defun siren-toml-mode-setup ()
|
|
"Default tweaks for `toml-mode'."
|
|
(run-hooks 'prog-mode-hook)
|
|
(setq-local tab-width 2))
|
|
|
|
(provide 'siren-toml)
|
|
;;; siren-toml.el ends here
|