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-modedoesn'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-modeyourself.The documentation for
c-doc-comment-stylehas this to say:You can make up a name like
rstdocfor use as the value ofc-doc-comment-styleand 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-styleas a directory-local or file-local variable. See the commandsadd-dir-local-variableandadd-file-local-variable.