emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 8f446c2d39 1/2: Fix c-ts-mode comment indentation (bug#60270)


From: Yuan Fu
Subject: emacs-29 8f446c2d39 1/2: Fix c-ts-mode comment indentation (bug#60270)
Date: Thu, 12 Jan 2023 20:11:49 -0500 (EST)

branch: emacs-29
commit 8f446c2d39736d752829e37100eede3f484b827e
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Fix c-ts-mode comment indentation (bug#60270)
    
    * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Move the
    star rule up.
---
 lisp/progmodes/c-ts-mode.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 5c7df4b214..e53ed390ba 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -122,11 +122,13 @@ MODE is either `c' or `cpp'."
            ((node-is "else") parent-bol 0)
            ((node-is "case") parent-bol 0)
            ((node-is "preproc_arg") no-indent)
+           ;; `c-ts-mode--looking-at-star' has to come before
+           ;; `c-ts-mode--comment-2nd-line-matcher'.
+           ((and (parent-is "comment") c-ts-mode--looking-at-star)
+            c-ts-mode--comment-start-after-first-star -1)
            (c-ts-mode--comment-2nd-line-matcher
             c-ts-mode--comment-2nd-line-anchor
             1)
-           ((and (parent-is "comment") c-ts-mode--looking-at-star)
-            c-ts-mode--comment-start-after-first-star -1)
            ((parent-is "comment") prev-adaptive-prefix 0)
            (c-ts-mode--top-level-label-matcher point-min 1)
            ((node-is "labeled_statement") parent-bol 0)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]