Very new to emacs. (I only started day before yesterday.) I'm writing some Java and was wondering if there's an option or something I can set up so it will indent Javadoc comments correctly.
What I mean by that is, if I type:
public class NiftyClass {
/*
* Here's what this method does.
*
* @return the answer
*/
every time I hit enter to start a new line in the Javadoc comments the pointer is at the left margin. Inside the body of a method when I hit enter it takes me to the next line at the correct indentation. I'd prefer that it do something similar with these comments, such that the pointer aligns itself underneath the previous *. Or, better yet, that it add the next *space for me and start me right after that.
Is there anything that can do this?
M-j
opens new line in comments, but what exactly it does depends on the mode settings. It is bound tocomment-indent-new-line
.M-j
could be bound to something other thancomment-indent-new-line
, but in general Emacs user would learn to expectM-j
to continue comment on a new line.