help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

c-mode & indenting block comments


From: jrwats
Subject: c-mode & indenting block comments
Date: Wed, 17 Sep 2008 08:30:33 -0700 (PDT)
User-agent: G2/1.0

So I'm working on some legacy code that has comments appearing like
so:
/*---------------------------------------*\
 * Sample Comment
 * blah blah blah
\*---------------------------------------*/

The problem, (I'm using the Stroustrup c-indentation-style - but this
occurs for all of them) when I run my favorite file cleanup key
sequence of:
C-x h
C-M-\

and get everything tabbed nice and pretty is that I end up with the
last line of the comment block shifted one to the right.
/*---------------------------------------*\
 * Sample Comment
 * blah blah blah
 \*---------------------------------------*/

Is there a c-indentation-style setting I can create to tell c-mode (or
whoever is responsible here) to leave all block comments where they
currently are and don't try tabbifying them?

Basically anywhere between /* and */ I want off limits for c-mode's
indentation.

I've played with setting the c attribute in c-offsets-alist to nil and
0, but that just placed the *'s in the middle all the way to the left
and I had played with c-comment-only-line-offset, trying:
(c-comment-only-line-offset . nil)
(c-comment-only-line-offset . 0)
(c-comment-only-line-offset . 0 . 0)
having all fail.

I really don't want to resort to:
Search and replace ' \*' with '\*'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]