From: Herbert E. <her...@ho...> - 2006-11-27 13:15:34
|
Yes, it works. Thank you. Regards, Guanpeng Xu >From: martin rudalics <rud...@gm...> >To: Herbert Euler <her...@ho...> >CC: mi...@gn..., mo...@ir..., bug...@gn..., >len...@st..., rm...@gn..., ema...@gn... >Subject: Re: Fill for // style comments in C >Date: Mon, 27 Nov 2006 10:47:29 +0100 > > > 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) _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ |