From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-24 d69e9f1: CC Mode: Stop Font Lock forcing fontification from BOL. Fixes debbugs#19669. Date: Fri, 20 Mar 2015 09:34:52 -0700 Message-ID: <550C4C2C.9060807@dancol.org> References: <20150201212213.17840.3710@vcs.savannah.gnu.org> <55076CF8.60309@dancol.org> <20150318120806.GA4160@acm.fritz.box> <550A43BB.3070904@dancol.org> <20150319093110.GA2753@acm.fritz.box> <20150319203724.GB2753@acm.fritz.box> <20150320163027.GB3493@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KE9FV1GkpaeDpGXv2iDLMPqvrjTQiq1e4" X-Trace: ger.gmane.org 1426869320 15027 80.91.229.3 (20 Mar 2015 16:35:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 16:35:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 20 17:35:19 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YYzt5-0007Ik-6n for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2015 17:35:07 +0100 Original-Received: from localhost ([::1]:44769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzt4-00040z-9y for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2015 12:35:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzsz-0003zr-VR for emacs-devel@gnu.org; Fri, 20 Mar 2015 12:35:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYzsz-0007rQ-4o for emacs-devel@gnu.org; Fri, 20 Mar 2015 12:35:01 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:54497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzsy-0007o7-RD for emacs-devel@gnu.org; Fri, 20 Mar 2015 12:35:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=cB5bGVWs81TROg0MyYaEryHy4K50fql8KKiZyKGHy5w=; b=btaXGAcWq1RLjiR3ci7Kx5t8GDB64cCR26F5Aicf+PS8qRpzFfIA0mra2S2zkbkbN6Nfh0kKh3lxPRBiVy40w7QJTBB2+WjeSiihl61/FP3Pl6fFGF/6FnDvzodrUXU5zBHtd57ApjTKzR5QlHsBUE65sUKC3Q99yYiCfuDiypMyfxqyzfkXSm9t7jYGMpFXP8zo3MB2iAcvk3I5cKy0PfNnWKKAuklDv9E6S4QzZEta7kLZ1KY02PyOBRpFNyWFrVlAixW+pa5ODsVV2kYr0kgf0oznipzivGopyNyUvU7PiG/VvHhIrWax9r/Oo1XKeDX2lE+EzYyqIR/ygr1A2Q==; Original-Received: from [2601:8:b240:1c1::2b1] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YYzss-0004VH-BZ; Fri, 20 Mar 2015 09:34:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: <20150320163027.GB3493@acm.fritz.box> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184044 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KE9FV1GkpaeDpGXv2iDLMPqvrjTQiq1e4 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 03/20/2015 09:30 AM, Alan Mackenzie wrote: > Hello, Stefan. >=20 > On Thu, Mar 19, 2015 at 04:56:16PM -0400, Stefan Monnier wrote: >>>> you can handle fontification from 1,3, or 4 but not from 2. You nee= d to >>>> refine the system you use to keep track of whether we're within >>>> a `union' so that it knows that position 2 is also "within a union".= >=20 >>> Well, sort of. The problem I'm facing is that in Dima Kogan's bug >>> #19669, the following construct appears: >=20 >>> 1. enum xxx_xxxx_xxxxxxxxxx_x >>> 2. {XXX_XXXXXX_XXXX_XXX, >>> 3. XXX_XXXXXX_XXX_XXX, >>> 4. XXXX_XXXXX_XXXX_XXX, >=20 >>> Note that the brace on L2 is on the same line as the first XXX_.... >=20 >>> When the user types on line 4, 5, ... here, CC Mode sets the >>> fontification region start to JUST AFTER THE { ON L2. It is essentia= l >>> that Font Lock doesn't change this. >=20 >> There's your problem: your current setup needs the starting point to b= e >> either before "union" or after the first open brace. >> It breaks down if it's between the two. That's the problem you need t= o fix. >=20 > Not really. CC Mode is quite capable of handling the Font Lock region > starting at BOL2. The problem is, when that starting point needs to be= > after the brace on L2, Font Lock moves the starting point somewhere > else, fouling up the font locking. This is proving surprisingly tough > to fix. I don't understand. Why shouldn't I be able to tell cc-mode to fontify *arbitrary* regions and expect it to correctly apply highlighting to these regions? It's the idea that the region "needs to be after brace" that I find confusing. Shouldn't jit-lock have the right to expand the region arbitrarily? --KE9FV1GkpaeDpGXv2iDLMPqvrjTQiq1e4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJVDEwsAAoJEN4WImmbpWBlrfgP/1MtkTQkp6biwtfdmZ4Pvwvn A/iz0e45l56k/UsIMl5JR59h+iQtSGdSd40JYsXKi7b4sIw8uO0x0FBLzo9R2+ie ujPe4mdhuVgOpxdsB9Y98ekYu/ApsYy1LS3yRFLHcdGjBri3/FUG5busKWourmZf e1tqC2QNOUeldLYb+j/qzEEZWPspkBZN5BH7Bx12bARS45ZWhTSiOjK459Ve6KuM EwN7aayi+F5Kf27tMeoFWGeF3mIsfvuYzzZba3VkhkE0+IkEeUVkW4GKpNCIKG3y bhyDVTWfq4IzwyOsJCE/4g6gg9+3tgPn9YzkyvTKmPEi+EyA9sWkV/t7icEi4Rcf +9o5H9K923mlCG9fdDbpj+WISXF7aZM8O8vMF0SZYiUy+28abNOLlD4+IhBwkg/u l2vFIDy/8EgmMReXsSS+0n/n1/fyxLl+HshNypriIptogFeCOlP5AimzbVNMYbbC UAZd2y3iB8u0YKOA3NLHv13hFkc4KkwU1neCES8Txd85QcoJ6fnn16HBgYUK6Oje qCwcsXBJofUaeb2E/SqNbhJ0qe8yUMEVQ+pFyCe4v/5y9s+Xzg26GzLMRvtHOZnR jd2ZDW8ndhjmZ7HKAhIXetdYLrYOHqaigYFxNKjQ+IXzeBI571kJsft60bkAfZOc Wo9LQqUdcSelVCOeMaup =F8h0 -----END PGP SIGNATURE----- --KE9FV1GkpaeDpGXv2iDLMPqvrjTQiq1e4--