From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: font-locking and open parens in column 0 Date: Sun, 05 Nov 2006 02:08:53 -0500 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1162710676 4192 80.91.229.2 (5 Nov 2006 07:11:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 5 Nov 2006 07:11:16 +0000 (UTC) Cc: rudalics@gmx.at, acm@muc.de, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 05 08:11:15 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ggc9w-0004xN-SL for ged-emacs-devel@m.gmane.org; Sun, 05 Nov 2006 08:11:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ggc9w-0003Rn-B3 for ged-emacs-devel@m.gmane.org; Sun, 05 Nov 2006 02:11:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ggc7m-0002G4-JR for emacs-devel@gnu.org; Sun, 05 Nov 2006 02:08:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ggc7m-0002Fi-0R for emacs-devel@gnu.org; Sun, 05 Nov 2006 02:08:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ggc7l-0002Fd-So for emacs-devel@gnu.org; Sun, 05 Nov 2006 02:08:57 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Ggc7l-00028K-Gu for emacs-devel@gnu.org; Sun, 05 Nov 2006 02:08:57 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1Ggc7h-00061g-RR; Sun, 05 Nov 2006 02:08:54 -0500 Original-To: "Mackenzie, Alan" In-reply-to: (AMackenzie@harmanbecker.com) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:61811 Archived-At: CC Mode always sets o-p-i-c-0-i-d-start to nil, and caches the brace structure to prevent excessive scanning from BOB. After all, opic0id being nil will always find BO-defun. Setting it to t was an optimisation for when computers were much less powerful than they are now - and this causes quite a bit of inconvenience. That optimization may still be important. It is ok for CC mode to set this to nil IF it provides another optimization which does the same job. For instance, using the cache. If that makes the same operations fast, then we don't need the paren-in-column-0 optimization. There is some doubt about whether your cache is getting used for all the operations that do this. >... which parallels the work of `syntax-ppss', hence we currently end up >with two caches for the same structures - I know c-mode has to work hard >to handle all sorts of older (X)Emacsen ... Not only that, CC Mode uses its cache for things other than font-locking. Could CC mode use `syntax-ppss' for all those things? If so, it could get rid of its own cache and rely on the cache in `syntax-ppss'. >It does fix it, and it's even pretty fast ;-). But I still think the >"bug" is with the author who put the left paren in column zero of that >comment. That author should be warned just as in emacs-lisp-mode. Should _HAVE_ been warned. Martin Stjernholm has worked very hard to remove that restriction from C Mode without sacrificing (much) speed. It would be a shame now to leave the restriction in Emacs 22. I agree that if CC mode is not confused by that paren in column 0 then there is no need to flag it for the user.