Comments on C indentation block in Emacs

I am trying to configure emacs in order to debug comments on block C.

Emacs (22.3) by default (regardless of the indentation style):

  / * My very long comment which spreads over multiple lines
 * and thus needs to be filled.
 * /

But I would prefer:

  / * My very long comment which spreads over multiple lines
  * and thus needs to be filled.
  * /

I tried playing around with c-offset-alist and the syntax symbol `c ', but that didn't help me understand the problem:

(c-add-style "mine" '((c-basic-offset . 2) (c-block-comment-prefix . "* ") (c-offsets-alist (c . +))) ) 

Any ideas? Thanks in advance!

Cheers, Daniel

+6
c comments emacs
source share
2 answers

Hm, it works here from 22.3.1 and starts with the -Q option, which does not load personal or lisp site files. Sorry to not help much, but I think this is your setting. Try making "emacs -Q" and see if you still have the same problem.

+3
source share

You can simply change the c-block-comment-prefix prefix to "*",

or make sure c-comment-prefix-regexp is /// + \\ | \\ ** ".

Below is the corresponding GNU.org CC mode man page.

0
source share

All Articles