Open mattiasdrp opened 4 years ago
I think that the proper way to do something like this would be customizing comment-start. See newcomment.el for more information about that.
However, I don't have a reference for similar features of major modes concerning doc comments, so I am unlikely to work on that myself. I unually just do the markup myself by hand when needed (like one does for doxygen-style comment.
Concerning existing integration, notice that default-indent-new-line
allows you to keep markup from line to line, so all you need to do is to choose the markup for the first doc line.
I think that the proper way to do something like this would be customizing comment-start. See newcomment.el for more information about that.
Problem with comment-start
is that modifying it would change the behaviour of comment-dwim
, from what I understood, no?
Concerning existing integration, notice that default-indent-new-line allows you to keep markup from line to line, so all you need to do is to choose the markup for the first doc line.
Ah, thanks for the default-indent-new-line
, will definitely use it :-)
As of now using
comment-line
orcomment-dwim
will always open a comment with//
.I needed some doc comments (
///
or//!
) so I implemented mine (inspired by http://ergoemacs.org/emacs/elisp_comment_command.html, thanks a lot!) hoping it would help:Which allows to comment as
///
when pressing Ctrl-Alt-; and//!
when pressing Ctrl-Alt-,It would actually be better to have these two functions available in the mode to bind them to some keys but I'm actually really bad at writing Lisp to do it