Fix c-ts-mode--emacs-c-range-query
* lisp/progmodes/c-ts-mode.el (c-ts-mode--emacs-c-range-query): Check for (treesit-available-p).
This commit is contained in:
parent
7f94558b77
commit
610a7657e0
1 changed files with 8 additions and 7 deletions
|
@ -1025,13 +1025,14 @@ For BOL see `treesit-simple-indent-rules'."
|
||||||
(looking-at c-ts-mode--for-each-tail-regexp))))
|
(looking-at c-ts-mode--for-each-tail-regexp))))
|
||||||
|
|
||||||
(defvar c-ts-mode--emacs-c-range-query
|
(defvar c-ts-mode--emacs-c-range-query
|
||||||
(treesit-query-compile
|
(when (treesit-available-p)
|
||||||
'emacs-c `(((declaration
|
(treesit-query-compile
|
||||||
type: (macro_type_specifier
|
'emacs-c `(((declaration
|
||||||
name: (identifier) @_name)
|
type: (macro_type_specifier
|
||||||
@for-each-tail)
|
name: (identifier) @_name)
|
||||||
(:match ,c-ts-mode--for-each-tail-regexp
|
@for-each-tail)
|
||||||
@_name))))
|
(:match ,c-ts-mode--for-each-tail-regexp
|
||||||
|
@_name)))))
|
||||||
"Query that finds a FOR_EACH_* macro with an unbracketed body.")
|
"Query that finds a FOR_EACH_* macro with an unbracketed body.")
|
||||||
|
|
||||||
(defvar-local c-ts-mode--for-each-tail-ranges nil
|
(defvar-local c-ts-mode--for-each-tail-ranges nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue