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