Emacs uses c-doc-comment-style
to specify the documentation comment style to use in cc-mode
. I'd like to use reStructuredText, or rst, for documentation comments. There's an rst-mode
for reStructuredText files, with rst-font-lock-keywords
, but I can't seem to be able to connect the two.
Furthermore, I'd like to be able to use different styles for different projects, as obviously a lot of projects use gtkdoc
or doxygen
styles.
cc-mode
doesn't have support for reStructuredText, and I don't know any simple way to reuserst-mode
's highlighting incc-mode
. I think you'll have to write the appropriate code forcc-mode
yourself.The documentation for
c-doc-comment-style
has this to say:You can make up a name like
rstdoc
for use as the value ofc-doc-comment-style
and implement it by defining a couple of variables. The existing definitions, as well as the regexps inrst-mode
, will probably be useful as a source of examples.This one is easy. You can set
c-doc-comment-style
as a directory-local or file-local variable. See the commandsadd-dir-local-variable
andadd-file-local-variable
.