emacs-devel
[Top][All Lists]
Advanced

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

Re: Fill for // style comments in C


From: Herbert Euler
Subject: Re: Fill for // style comments in C
Date: Mon, 27 Nov 2006 15:44:52 +0800

And in c-mode, pressing M-q in between comments like this:

// A real long comment that will cause the fill command in Emacs C mode making mistakes.

will get

// A real long comment that will cause the fill command in Emacs C
mode making mistakes.

But for /* */ style comment, it will be

/* A real long comment that will cause the fill command in Emacs C
  mode making mistakes. */

And in c++-mode,

// A real long comment that will cause the fill command in Emacs C mode making mistakes.

will be changed to

// A real long comment that will cause the fill command in Emacs C
// mode making mistakes.

when pressing M-q.

Regards,
Guanpeng Xu

From: Miles Bader <address@hidden>
Reply-To: Miles Bader <address@hidden>
To: Stefan Monnier <address@hidden>
CC: address@hidden, address@hidden, address@hidden,address@hidden
Subject: Re: Fill for // style comments in C
Date: Mon, 27 Nov 2006 15:34:28 +0900

Stefan Monnier <address@hidden> writes:
>> C mode does support // comments in other ways, so if it doesn't
>> enable filling of them, I think that is a bug.
>
> I still haven't seen any clear report that it doesn't work (just some vague
> remarks about whether or not it works).

Consider the following in c-mode (with indentation removed):

   // this is a test
   // foo bar
   int a ()
   {
   }

If you position the point on the word "test", and hit M-q (bound to
`c-fill-paragraph'), nothing happens.

If you then do `M-x c++-mode', and hit M-q again, the comment is filled
as you might expect.

_However_ if you use `M-x fill-paragraph' instead of M-q
(c-fill-paragraph), then it works correctly in both modes -- so it
appears that the bug is with c-fill-paragraph.

-Miles

--
I'm beginning to think that life is just one long Yoko Ono album; no rhyme
or reason, just a lot of incoherent shrieks and then it's over. --Ian Wolff


_______________________________________________
Emacs-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-devel

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

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