From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw. Date: Fri, 15 Dec 2006 23:20:25 +0100 Message-ID: <85hcvw7qdy.fsf@lola.goethe.zz> References: <20061210014526.GB3738@muc.de> <877ix0lfm8.fsf@furball.mit.edu> <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> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1166221276 32336 80.91.229.10 (15 Dec 2006 22:21:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Dec 2006 22:21:16 +0000 (UTC) Cc: martin rudalics , Chong Yidong , emacs-devel@gnu.org, Richard Stallman , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 15 23:21:15 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 1GvLQU-0001MR-QP for ged-emacs-devel@m.gmane.org; Fri, 15 Dec 2006 23:21:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvLQU-0002p4-93 for ged-emacs-devel@m.gmane.org; Fri, 15 Dec 2006 17:21:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GvLQF-0002n7-Fb for emacs-devel@gnu.org; Fri, 15 Dec 2006 17:20:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GvLQD-0002kS-AE for emacs-devel@gnu.org; Fri, 15 Dec 2006 17:20:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvLQD-0002kH-1w for emacs-devel@gnu.org; Fri, 15 Dec 2006 17:20:53 -0500 Original-Received: from [212.7.152.118] (helo=mxout04.versatel.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GvLQB-0003D6-H7; Fri, 15 Dec 2006 17:20:52 -0500 Original-Received: from mx02.versatel.de (mx01.versatel.de [212.7.146.1]) by mxout04.versatel.de (8.13.1/8.13.1) with ESMTP id kBFMKi0D028043; Fri, 15 Dec 2006 23:20:49 +0100 Original-Received: from lola.goethe.zz (i53878F0D.versanet.de [83.135.143.13]) by mx02.versatel.de (8.12.11.20060614/8.12.11) with ESMTP id kBFMKiA4019730; Fri, 15 Dec 2006 23:20:44 +0100 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 4172F1C3DB40; Fri, 15 Dec 2006 23:20:26 +0100 (CET) Original-To: Alan Mackenzie In-Reply-To: <20061215203326.GB2795@muc.de> (Alan Mackenzie's message of "15 Dec 2006 20\:22\:46 +0100\, Fri\, 15 Dec 2006 20\:33\:26 +0000") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) 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:63799 Archived-At: Alan Mackenzie writes: > Yet we're Emacs experts. I think we're placing too little > importance on the shock and emotional distress that such a bug > [totally hosed fontification over an entire screen] will cause an > ordinary Emacs user. Even highlighting these parens might well > puzzle, rather than help, this user. Fontification is known not to be perfect, and there is an easy way around if you feel shocked: change the input. Such a change is required for a number of other source code management tools like ctags anyway. This is a one-time effect. In contrast, editing slowdowns are permanent and incurable. There are other modes, like LaTeX-mode, where the fontification engine has no chance of figuring out everything correctly. So one uses simple hacks like \def\xxx#1{\if$#1% $ where a comment is added that does nothing but close a $ math environment that would otherwise be highlighted permanently. People are _used_ to putting such stuff in if it annoys them too much. It _is_ important, however, that there are easy workarounds. For that reason, AUCTeX matches dollar signs in line comments (one developer made them ignored out of "correctness" concerns, and I vetoes this, since it is impossible to get TeX fontification correct automatically, anyway, and making the workarounds harder is a nuisance). In the case of C-mode, there is a perfect workaround that requires no undue amount of tap-dancing. I don't see any reason to introduce little-tested, slow code that already has lead to infinite loops and quite a bit of trouble at this point of time in pretest. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum