]> git.eshelyaron.com Git - emacs.git/commitdiff
; Use cpp instead of c++ for c-ts-mode--simple-indent-rules
authorYuan Fu <casouri@gmail.com>
Tue, 3 Dec 2024 03:39:10 +0000 (19:39 -0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 6 Dec 2024 15:42:42 +0000 (16:42 +0100)
* 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.

(cherry picked from commit 5d535334f30b874ebb8e2c286c1e059d86ccd41f)

lisp/progmodes/c-ts-mode.el

index 710160ea472c0655f1311579fc944161e9b12d00..dec9411b87c1d203f69b30d83500ff816c9fe588 100644 (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