Next: Options for Comments, Previous: Comment Commands, Up: Comments
If you are typing a comment and wish to continue it to another line,
type M-j or C-M-j (
breaks the current line, and inserts the necessary comment delimiters
and indentation to continue the comment.
For languages with closing comment delimiters (e.g., ‘*/’ in
C), the exact behavior of M-j depends on the value of the
comment-multi-line. If the value is
command closes the comment on the old line and starts a new comment on
the new line. Otherwise, it opens a new line within the current
When Auto Fill mode is on, going past the fill column while typing a comment also continues the comment, in the same way as an explicit invocation of M-j.
To turn existing lines into comment lines, use M-; with the region active, or use M-x comment-region as described in the preceding section.
You can configure C Mode such that when you type a ‘/’ at the
start of a line in a multi-line block comment, this closes the
comment. Enable the
comment-close-slash clean-up for this.