This post reveals a nice function comment-indent-new-line
which gives you the
right kind of indentation for block comments. That got me wondering if my
enter
key-binding should do different things depending upon whether or not the
cursor is inside of a comment block or not. Specifically, if it is, then call
the aforementioned function, else call the normal binding. This seems that it
might be an improvement
This post explains how to check if the cursor is inside of a comment block:
(nth 4 (syntax-ppss))
It is not nil when the point (cursor) is inside of a comment block.
Great to know.
I decided not to make this change yet, but, I wanted to capture how, here.
Grant Rettke: How to handle the enter key while inside of comment blocks http://t.co/7Kj5VdV1Z6
I too read that SE question and found it interesting. But you blog post nudged me to add a fine nuance to my `pull-up-line` function: http://emacs.stackexchange.com/q/7519/115
Thanks! 🙂
KAUSHAL MODI:
Thank you, sir. Nice hack.