unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* multi-line comments in cc-mode
@ 2003-06-03 19:10 Tony Tung
  0 siblings, 0 replies; only message in thread
From: Tony Tung @ 2003-06-03 19:10 UTC (permalink / raw)


Background info: GNU Emacs 21.3.1; cc-mode with auto-fill-mode.
c-block-comment-prefix is set to "* "

I posted this a few weeks ago to comp.emacs and gnu.emacs.help, but got no
responses.  I did do a bit more experimentation and got some more data.
Hopefully it'll be useful.

If I have a comment that looks like this:

   /* lot's of text here and so forth blah blah blah ...

When I reach the fill column, I get:

   /* lot's of text here and so forth blah blah blah ...
    * blah blah blah ...

This is expected.  Since this is the first time the comment block is
broken, Emacs doesn't know how to prefix and automagically puts the "* "
(from c-block-comment-prefix) in front.  All is good.  I continue typing
and I get:

   /* lot's of text here and so forth blah blah blah ...
    * blah blah blah ...
   blah blah blah blah

Wow, not good!  How come it didn't understand the prefix from the previous
two lines?  The odd thing is that if the comment starts in column 1, it
works as expected, like this:

/* lot's of text here and so forth blah blah blah ...
 * blah blah blah ...
 * blah blah blah blah

I did a little more experimenting and discovered that if I put two empty
lines in the block comment first, it always works correctly.  That is,

    /* 
     *
     * lot's of text here and so forth blah blah blah ...
     * blah blah blah 

will correctly fill to become:

    /* 
     *
     * lot's of text here and so forth blah blah blah ...
     * blah blah blah ...
     * blah blah blah blah

Any ideas?  Thanks.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-03 19:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-03 19:10 multi-line comments in cc-mode Tony Tung

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).