1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

; 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.
This commit is contained in:
Yuan Fu 2024-04-22 21:55:45 -07:00
parent 1f443c277a
commit 6ae835c924
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View 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 (* " "))))