GNU Emacs Manual - Comment Commands Go to the first , previous , next , last section, table of contents . The comment commands insert, kill and align comments. If there is no comment already on the line, a new comment is created, aligned at a specific column called the comment column .
Point is left after that string.
If the major mode has specified a string to terminate comments, that is inserted after point, to keep the syntax valid. Some major modes have special rules for indenting certain kinds of comments in certain contexts. For example, in Lisp code, comments which start with two semicolons are indented as if they were lines of code, instead of at the comment column. Comments which start with three semicolons are supposed to start at the left margin. In C code, a comment preceded on its line by nothing but whitespace is indented like a line of code.