unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tony Tung <tonytung@bigfoot.com>
Subject: multi-line comments in cc-mode
Date: Tue, 3 Jun 2003 19:10:10 +0000 (UTC)	[thread overview]
Message-ID: <slrnbdpski.1kog.tonytung@soda.csua.berkeley.edu> (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.

                 reply	other threads:[~2003-06-03 19:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrnbdpski.1kog.tonytung@soda.csua.berkeley.edu \
    --to=tonytung@bigfoot.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).