; * lisp/progmodes/c-ts-mode.el: allow loading file without treesit

This commit is contained in:
Mattias Engdegård 2023-05-01 19:08:12 +02:00
parent d01543f114
commit 7d246c359c

View file

@ -1001,13 +1001,14 @@ For BOL see `treesit-simple-indent-rules'."
(looking-at c-ts-mode--for-each-tail-regexp))))
(defvar c-ts-mode--emacs-c-range-query
(treesit-query-compile
'emacs-c `(((declaration
type: (macro_type_specifier
name: (identifier) @_name)
@for-each-tail)
(:match ,c-ts-mode--for-each-tail-regexp
@_name))))
(and (treesit-available-p)
(treesit-query-compile
'emacs-c `(((declaration
type: (macro_type_specifier
name: (identifier) @_name)
@for-each-tail)
(:match ,c-ts-mode--for-each-tail-regexp
@_name)))))
"Query that finds a FOR_EACH_* macro with an unbracketed body.")
(defvar-local c-ts-mode--for-each-tail-ranges nil