From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: regression: filling comments in C++ code (today's CVS) Date: Mon, 20 Jan 2003 11:54:13 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301201654.h0KGsDJ10072@rum.cs.yale.edu> References: <5b65sl53l3.fsf@lister.roxen.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1043082922 31396 80.91.224.249 (20 Jan 2003 17:15:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 20 Jan 2003 17:15:22 +0000 (UTC) Cc: Stefan Monnier Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18afW4-0008AF-00 for ; Mon, 20 Jan 2003 18:15:20 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18afh2-0007Sr-00 for ; Mon, 20 Jan 2003 18:26:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18afNt-0000hV-0B for emacs-devel@quimby.gnus.org; Mon, 20 Jan 2003 12:06:53 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18afLM-0000Ci-00 for emacs-devel@gnu.org; Mon, 20 Jan 2003 12:04:16 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18afEm-0007QP-00 for emacs-devel@gnu.org; Mon, 20 Jan 2003 11:57:30 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18afBh-0006IT-00; Mon, 20 Jan 2003 11:54:17 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id h0KGsDJ10072; Mon, 20 Jan 2003 11:54:13 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Martin Stjernholm Original-cc: Robert Anderson Original-cc: emacs-devel@gnu.org Original-cc: bug-cc-mode@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10904 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10904 > > Why on earth does cc-mode rebind M-q instead of setting > > fill-paragraph-function ? > > Because c-fill-paragraph doesn't do the actual filling. It masks the > comment or string the point is within and calls the normal fill > function to make the appropriate adaptive filling etc. For this to > work it must run first, before any other code has tried to do things > like calculate the fill prefix and thereby clobbered its true value. But that's what fill-paragraph does. It first calls fill-paragraph-function. > Specifically, the filladapt package replaces fill-paragraph with its > own variant that calculates the adaptive fill prefix before calling > fill-paragraph-function. CC Mode must do the comment masking before > that to make it adapt to the proper prefix. Ah, so it's because filladapt does not faithfully implement the fill-paragraph interface. For the sake of correctness in cases other than filladapt, how about setting fill-paragraph-function (while still keeping the rebinding of M-q) so that calling fill-paragraph DTRT. Stefan