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

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

Re: c++-mode and multiline comments


From: Alan Mackenzie
Subject: Re: c++-mode and multiline comments
Date: Tue, 23 Jun 2009 19:06:04 +0000
User-agent: Mutt/1.5.9i

Hi, Michal!

On Tue, Jun 23, 2009 at 06:39:39PM +0200, Michal wrote:

> Hallo Group Readers!

> pressing M-j in the following position:
> int main() {   /*
>                 * <CURSOR HERE>


> makes emacs start new line inented to the comment above and "* " added.

Yes.  It looks at the _second_ line, and copies the "comment prefix" onto
the new line

> but, when:
> int main() {   /*<CURSOR HERE>


> and I press M-j, then cursor goes to new line but does not add "* ".

Yes, because there's no second line to take the comment prefix from.

> Is it possible to configure multiline comments to do so?

Yes.  Set the style variable `c-block-comment-prefix' to "* ".  This
variable is precisely for what you want, and it is documented on page
"Custom Filling and Breaking" of the CC Mode manual (which you surely
have).

For all the fancy ways you can set a style variable, see page "Custom
Filling and Breaking"; if you can't be bothered reading this, the
simplest way to set the variable is to simply set it early on in your
.emacs, say with

    (setq c-block-comment-prefix "* ")

.

All the best!

> best regards
> Michal

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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