]> git.eshelyaron.com Git - emacs.git/commitdiff
; Add some comments to c-ts-common-comment-indent-new-line
authorYuan Fu <casouri@gmail.com>
Tue, 23 Apr 2024 04:55:45 +0000 (21:55 -0700)
committerEshel Yaron <me@eshelyaron.com>
Tue, 23 Apr 2024 10:13:53 +0000 (12:13 +0200)
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Add comments.

(cherry picked from commit 6ae835c924124a743d4f9dc6255ff1a3bd09ba6f)

lisp/progmodes/c-ts-common.el

index 025703d7fcea86314a65e29b73424355bc2c7b35..457aa55c195216bb4c55be899996255ff07e8cbe 100644 (file)
@@ -301,7 +301,7 @@ and /* */ comments.  SOFT works the same as in
       (delete-region (line-beginning-position) (point))
       (insert "//" whitespaces)))
 
-   ;; Line starts with /* or /**
+   ;; Line starts with /* or /**.
    ((save-excursion
       (beginning-of-line)
       (looking-at (rx "/*" (group (? "*") (* " ")))))
@@ -310,7 +310,7 @@ and /* */ comments.  SOFT works the same as in
       (delete-region (line-beginning-position) (point))
       (insert " *" (make-string whitespace-and-star-len ?\s))))
 
-   ;; Line starts with *
+   ;; Line starts with *.
    ((save-excursion
       (beginning-of-line)
       (looking-at (rx (group (* " ") (or "*" "|") (* " ")))))
@@ -319,7 +319,8 @@ and /* */ comments.  SOFT works the same as in
       (delete-region (line-beginning-position) (point))
       (insert prefix)))
 
-   ;; Line starts with whitespaces
+   ;; Line starts with whitespaces or no space.  This is basically the
+   ;; default case since (rx (* " ")) matches anything.
    ((save-excursion
       (beginning-of-line)
       (looking-at (rx (* " "))))