From: Yuan Fu Date: Tue, 23 Apr 2024 04:55:45 +0000 (-0700) Subject: ; Add some comments to c-ts-common-comment-indent-new-line X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5807488bbf6dedb171507c548828d125a3635fa9;p=emacs.git ; Add some comments to c-ts-common-comment-indent-new-line * lisp/progmodes/c-ts-common.el: (c-ts-common-comment-indent-new-line): Add comments. (cherry picked from commit 6ae835c924124a743d4f9dc6255ff1a3bd09ba6f) --- diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el index 025703d7fce..457aa55c195 100644 --- a/lisp/progmodes/c-ts-common.el +++ b/lisp/progmodes/c-ts-common.el @@ -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 (* " "))))