; Use cpp instead of c++ for c-ts-mode--simple-indent-rules

* lisp/progmodes/c-ts-mode.el (c-ts-mode--simple-indent-rules):
Use cpp to be more inline with other functions in c-ts-mode.el.
This commit is contained in:
Yuan Fu 2024-12-02 19:39:10 -08:00
parent 10b4d3045e
commit 5d535334f3
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -441,7 +441,7 @@ NODE and PARENT are the same as other indent rules."
"Return the indent rules for MODE and STYLE.
The returned value can be set to `treesit-simple-indent-rules'.
MODE can be `c' or `c++'. STYLE can be `gnu', `k&r', `linux', `bsd'."
MODE can be `c' or `cpp'. STYLE can be `gnu', `k&r', `linux', `bsd'."
(let ((rules
`((c-ts-mode--for-each-tail-body-matcher
prev-line c-ts-mode-indent-offset)
@ -513,7 +513,7 @@ MODE can be `c' or `c++'. STYLE can be `gnu', `k&r', `linux', `bsd'."
,@rules))))
(pcase mode
('c `((c . ,rules)))
('c++ `((cpp . ,rules))))))
('cpp `((cpp . ,rules))))))
(defun c-ts-mode--parenthesized-expression-indent-rule (_node parent &rest _)
"Indent rule that indents aprenthesized expression.
@ -1451,7 +1451,7 @@ recommended to enable `electric-pair-mode' with this mode."
;; Indent.
(setq-local treesit-simple-indent-rules
(c-ts-mode--simple-indent-rules
'c++ c-ts-mode-indent-style))
'cpp c-ts-mode-indent-style))
;; Font-lock.
(setq-local treesit-font-lock-settings