In c-mode comment-region is adding
/* */ style comments.
Is there a way to default to using C++ style
// prefix in C source files instead?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Support for toggling between block-style and line-style comments was added a few months ago, and should be included in the next release.
If you have a snapshot of the development version of emacs (from
master after June 15, 2017), you can use
(c-toggle-comment-style) to toggle the comment style.
And the related conversation on emacs-devel: http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=7a2038d7c887e4fa08a91950a7494d1dd20c39e1
To enable them by default:
(add-hook 'c-mode-hook (lambda () (c-toggle-comment-style -1)))
This can be done by changing
(add-hook 'c-mode-hook (lambda () (setq comment-start "//" comment-end "")))
Found the answer after further searching here