After writing functions in C/C++, I like to format my block comments that explain a function's purpose, parameters, use, and so on.
(See example below)
However, to indent my comments in emacs, I need to do C-q TAB
, which is a bit of an awkward set of keystrokes (not to mention having to press three keys as opposed to one).
My question is: what would the Elisp code be for:
- See whether or not what I'm typing is in a comment block (I'm thinking it has to do with
font-lock-comment-face
but I'm not sure - If the text is inside a block comment, have
TAB
perform the same functionality as the aforementionedC-q TAB
For more information, some of the shortcuts given in the Emacs guide, such as M-j
are helpful, but I still need to C-q TAB
to initially indent a region within the comment.