Files
.emacs.d/modules/text-editing/siren-tree-sitter.el
Jim Myhrberg fe6a4e7ce5 fix(elisp): add lexical-binding comment to all files to suppress new Emacs 31 warnings
I've set `lexical-binding` to `nil` in all Emacs Lisp files to suppress
the warnings introduced in Emacs 31 requiring all elisp files to have a
`lexical-binding` comment.

This retains the default behavior of dynamic binding when no
`lexical-binding` comment is present. With it set to `t` across the
board, various things break, and fixing those is a task for another day.
2025-06-29 12:23:03 +01:00

47 lines
1.1 KiB
EmacsLisp

;;; siren-tree-sitter.el --- jimeh's Emacs Siren: tree-sitter -*- lexical-binding: nil; -*-
;;; Commentary:
;; Configuration for tree-sitter
;;; Code:
(use-package tree-sitter
:hook
((css-mode
go-mode
js-mode
json-mode
lua-mode
nix-mode
php-mode
php-mode
python-mode
ruby-mode
rust-mode
;; terraform-mode ;; Disabled due to frequently locking up Emacs for minutes
typescript-mode
yaml-mode) . siren-tree-sitter-mode-enable)
:preface
(defgroup siren-tree-sitter nil
"Siren specific tweaks to tree-sitter-mode."
:group 'tree-sitter)
(defcustom siren-tree-sitter-incompatible-modes '(scss-mode)
"List of modes where tree-sitter-mode should not be enabled."
:type 'boolean
:group 'siren-tree-sitter)
(defun siren-tree-sitter-mode-enable ()
"Enable tree-sitter-mode if the current major mode is not in the banned list."
(unless (derived-mode-p siren-tree-sitter-incompatible-modes)
(tree-sitter-mode t))))
(use-package tree-sitter-langs
:hook
(tree-sitter-after-on . tree-sitter-hl-mode))
(provide 'siren-tree-sitter)
;;; siren-tree-sitter.el ends here