[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fill for // style comments in C
From: |
martin rudalics |
Subject: |
Re: Fill for // style comments in C |
Date: |
Mon, 27 Nov 2006 10:47:29 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> 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.
It's because `c-fill-paragraph' calls `c-mask-paragraph' the latter
calls `fill-paragraph' and `fill-paragraph' gets it wrong since it has
`comment-end' set to " */" instead of nil. Does the attached workaround
remove the problem?
*** progmodes/cc-cmds.el Mon Nov 27 10:32:48 2006
--- progmodes/cc-cmds.el Mon Nov 27 10:33:20 2006
***************
*** 3897,3903 ****
(prog1
(save-restriction
(narrow-to-region beg end)
! (apply fun args))
(if point-rel
;; Restore point if it was outside the region.
(if (< point-rel 0)
--- 3897,3905 ----
(prog1
(save-restriction
(narrow-to-region beg end)
! (if (eq c-lit-type 'c++)
! (apply 'fill-comment-paragraph args)
! (apply fun args)))
(if point-rel
;; Restore point if it was outside the region.
(if (< point-rel 0)
- Fill for // style comments in C, Lennart Borgman, 2006/11/17
- Re: Fill for // style comments in C, Miles Bader, 2006/11/18
- Re: Fill for // style comments in C, Richard Stallman, 2006/11/19
- Re: Fill for // style comments in C, Richard Stallman, 2006/11/26
- Re: Fill for // style comments in C, Stefan Monnier, 2006/11/27
- Re: Fill for // style comments in C, Miles Bader, 2006/11/27
- Re: Fill for // style comments in C, Herbert Euler, 2006/11/27
- Re: Fill for // style comments in C,
martin rudalics <=
- Re: Fill for // style comments in C, Herbert Euler, 2006/11/27
- Re: Fill for // style comments in C, Miles Bader, 2006/11/27
- Re: Fill for // style comments in C, Herbert Euler, 2006/11/28
- Re: Fill for // style comments in C, Miles Bader, 2006/11/28
- Re: Fill for // style comments in C, Herbert Euler, 2006/11/28
- Re: Fill for // style comments in C, martin rudalics, 2006/11/28
- Re: Fill for // style comments in C, Richard Stallman, 2006/11/29
- Re: Fill for // style comments in C, Stefan Monnier, 2006/11/29
- Re: Fill for // style comments in C, Herbert Euler, 2006/11/28
- Re: Fill for // style comments in C, Herbert Euler, 2006/11/28