Variable: cmake-ts-mode-hook
cmake-ts-mode-hook is a variable defined in cmake-ts-mode.el.gz.
Value
nil
Documentation
Hook run after entering CMake mode.
No problems result if this variable is not bound.
add-hook automatically binds it. (This is true for all hook variables.)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cmake-ts-mode.el.gz
;;;###autoload
(define-derived-mode cmake-ts-mode prog-mode "CMake"
"Major mode for editing CMake files, powered by tree-sitter."
:group 'cmake
:syntax-table cmake-ts-mode--syntax-table
(when (treesit-ready-p 'cmake)
(treesit-parser-create 'cmake)
;; Comments.
(setq-local comment-start "# ")
(setq-local comment-end "")
(setq-local comment-start-skip (rx "#" (* (syntax whitespace))))
;; Imenu.
(setq-local treesit-simple-imenu-settings
`(("Function" "\\`function_command\\'" nil cmake-ts-mode--function-name)))
(setq-local which-func-functions nil)
;; Indent.
(setq-local treesit-simple-indent-rules cmake-ts-mode--indent-rules)
;; Font-lock.
(setq-local treesit-font-lock-settings cmake-ts-mode--font-lock-settings)
(setq-local treesit-font-lock-feature-list
'((comment)
(keyword string)
;; 'function' and 'variable' here play slightly
;; different roles than in other ts modes, so we
;; kept them at level 3.
(builtin constant escape-sequence function number variable)
(bracket error misc-punctuation)))
(treesit-major-mode-setup)))