From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: Fill for // style comments in C Date: Mon, 27 Nov 2006 10:47:29 +0100 Message-ID: <456AB431.4020103@gmx.at> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090706070706050609050303" X-Trace: sea.gmane.org 1164620987 14409 80.91.229.2 (27 Nov 2006 09:49:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Nov 2006 09:49:47 +0000 (UTC) Cc: rms@gnu.org, lennart.borgman.073@student.lu.se, emacs-devel@gnu.org, bug-cc-mode@gnu.org, monnier@iro.umontreal.ca, miles@gnu.org Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Mon Nov 27 10:49:42 2006 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by ciao.gmane.org with esmtp (Exim 4.43) id 1God7G-0004kh-JZ for sf-cc-mode-help@m.gmane.org; Mon, 27 Nov 2006 10:49:34 +0100 Original-Received: from sc8-sf-list1-new.sourceforge.net (unknown [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id D9754F4F3; Mon, 27 Nov 2006 01:49:33 -0800 (PST) Original-Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1God7D-0004XH-Nl for cc-mode-help@lists.sourceforge.net; Mon, 27 Nov 2006 01:49:32 -0800 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1God7C-00055x-7k for cc-mode-help@lists.sourceforge.net; Mon, 27 Nov 2006 01:49:31 -0800 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.52) id 1God76-0003R8-V7 for bug-cc-mode@gnu.org; Mon, 27 Nov 2006 04:49:25 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.52) id 1God76-0001a4-ID for bug-cc-mode@gnu.org; Mon, 27 Nov 2006 04:49:25 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1God75-0001ZQ-Nj for bug-cc-mode@gnu.org; Mon, 27 Nov 2006 04:49:24 -0500 Original-Received: (qmail invoked by alias); 27 Nov 2006 09:49:21 -0000 Original-Received: from N708P010.adsl.highway.telekom.at (EHLO [62.47.32.106]) [62.47.32.106] by mail.gmx.net (mp036) with SMTP; 27 Nov 2006 10:49:21 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: Herbert Euler In-Reply-To: X-Y-GMX-Trusted: 0 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on monty-python X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=failed version=3.0.4 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.0 FORGED_RCVD_HELO Received: contains a forged HELO X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.1.8 Precedence: list List-Id: "Bug reports, feature requests, and general talk about CC Mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: cc-mode-help-bounces@lists.sourceforge.net Errors-To: cc-mode-help-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.cc-mode.general:4115 gmane.emacs.devel:62853 Archived-At: This is a multi-part message in MIME format. --------------090706070706050609050303 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > 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? --------------090706070706050609050303 Content-Type: text/plain; name="cc-cmds.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cc-cmds.patch" *** 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) --------------090706070706050609050303 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV --------------090706070706050609050303--