From 5807488bbf6dedb171507c548828d125a3635fa9 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 22 Apr 2024 21:55:45 -0700 Subject: [PATCH] ; 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) --- lisp/progmodes/c-ts-common.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 (* " ")))) -- 2.39.5