From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw. Date: Sun, 17 Dec 2006 18:28:06 +0100 Message-ID: <45857E26.1050107@gmx.at> References: <20061210102249.GA1235@muc.de> <87d56rpk7a.fsf@stupidchicken.com> <20061213224009.GA1206@muc.de> <87odq72ssy.fsf@stupidchicken.com> <20061214084713.GA1333@muc.de> <45812BDF.5050107@gmx.at> <20061214193733.GA1269@muc.de> <45824FA5.3050702@gmx.at> <20061215203326.GB2795@muc.de> <4583C7B0.4020201@gmx.at> <20061217125521.GB2643@muc.de> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1166379055 7023 80.91.229.10 (17 Dec 2006 18:10:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 17 Dec 2006 18:10:55 +0000 (UTC) Cc: Chong Yidong , Richard Stallman , Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 17 19:10:53 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gw0TM-0001IQ-25 for ged-emacs-devel@m.gmane.org; Sun, 17 Dec 2006 19:10:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gw0TL-0005Og-BE for ged-emacs-devel@m.gmane.org; Sun, 17 Dec 2006 13:10:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gw0T9-0005O1-IL for emacs-devel@gnu.org; Sun, 17 Dec 2006 13:10:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gw0T7-0005MQ-V2 for emacs-devel@gnu.org; Sun, 17 Dec 2006 13:10:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gw0T7-0005MD-L6 for emacs-devel@gnu.org; Sun, 17 Dec 2006 13:10:37 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1Gw0T7-00038C-7X for emacs-devel@gnu.org; Sun, 17 Dec 2006 13:10:37 -0500 Original-Received: (qmail invoked by alias); 17 Dec 2006 18:10:36 -0000 Original-Received: from N929P029.adsl.highway.telekom.at (EHLO [62.47.60.29]) [62.47.60.29] by mail.gmx.net (mp034) with SMTP; 17 Dec 2006 19:10:36 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: Alan Mackenzie In-Reply-To: <20061217125521.GB2643@muc.de> X-Y-GMX-Trusted: 0 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:63893 Archived-At: Hi Alan > OK, you've convinced me. I now agree with you that CC Mode should not > itself set that horrible variable to nil, not even as a default. I > should remove the offending line from cc-mode.el, and put some extra > explanation into cc-mode.texi and programs.texi. Thank you. I appreciate this as a wise and thoughtful step. Here I want to apologize for accusing your `beginning-of-defun-raw' change as the culprit of the misbehavior of C mode fontification over the past weeks. I really should have noticed the misbehavior before when doing a `scroll-down', `backward-sexp', or `recenter' with a negative argument. I'd also kindly ask everyone to not argue against Alan's change any more. As far as I can tell from here, the misbehavior is caused by a deficiency in back_comment when `open-paren-in-column-0-is-defun-start' equals nil. Alan's change simply revealed the misbehavior when jumping to the end of a large buffer. Using the default value for `open-paren-in-column-0-is-defun-start' should make all operations in C mode sufficiently fast for the release. > Another possibility would be a new option in CC Mode (probably > implemented as a Clean-Up), which would guard against rogue (s and {s in > column 0. Were this to be switched on, c-electric-paren, > c-electric-brace, and the filling routines would insert a \ at column 0 > when needed. > > The available evidence is that hackers cannot be expected to notice and > correct these things without help. Putting a `font-lock-warning-face' on such parens should be sufficient for the moment.