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: POC: customizable cc-mode keywords Date: Fri, 16 May 2014 11:06:24 -0700 Message-ID: <537653A0.2070109@dancol.org> References: <53632C6F.5070903@dancol.org> <20140511211351.GC2759@acm.acm> <536FEA43.5090402@dancol.org> <20140516175226.GB3267@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3dKDO00V0eowQHqj2TUuFoqErGjLkPA8x" X-Trace: ger.gmane.org 1400263610 16707 80.91.229.3 (16 May 2014 18:06:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 May 2014 18:06:50 +0000 (UTC) Cc: Emacs developers To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 16 20:06:43 2014 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 1WlMWj-0006EZ-KQ for ged-emacs-devel@m.gmane.org; Fri, 16 May 2014 20:06:37 +0200 Original-Received: from localhost ([::1]:37161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlMWj-0007my-6O for ged-emacs-devel@m.gmane.org; Fri, 16 May 2014 14:06:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlMWg-0007kR-06 for emacs-devel@gnu.org; Fri, 16 May 2014 14:06:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlMWe-0005Iq-Ug for emacs-devel@gnu.org; Fri, 16 May 2014 14:06:33 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:45451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlMWe-00055p-Ll for emacs-devel@gnu.org; Fri, 16 May 2014 14:06:32 -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=cb+165++B2SsTelPM3h//sV/R7ewhIZp+EC4I3hU6Tw=; b=eSQ3mWM2SdvAvnWP9zT7Cy6y6xiZDbyi8i4IOXvl+K/PXu9mHeOXDqSLw1PG2HNYTjoEp7nDjb/WnbKWORfOuDMIrwNkUBFocg+1ks3K2ySkNlSAWvLSEACoG8wKdBlr8J3+xd0rMxRB8Qw20mnZOTc96ZlZ3ZBAdtD4iTeqDfJ5suQXe7eaom5roDIRQ2P00aItxvXm/kjXwfkMqwB12W0Y2NcM1yy5RCA+uXt9QznH4fWdV4TkRDLLMam3nFOuKfrPHmqHJka0Xj/c9iZP20Vnh5TrD7uMzMkkXkrhPg80OhBBkIqTb49XsytgxyDs9RNEwEfNLDwOIUSmTEoa1w==; Original-Received: from [2601:8:b240:2a1::2b1] by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1WlMWX-00050Y-Sx; Fri, 16 May 2014 11:06:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <20140516175226.GB3267@acm.acm> X-Enigmail-Version: 1.6 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:171891 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3dKDO00V0eowQHqj2TUuFoqErGjLkPA8x Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 05/16/2014 10:52 AM, Alan Mackenzie wrote: >>>> Today, we use clever macros to hard-code the values of all cc-mode >>>> language variables into the mode functions of each cc-mode major mod= e >>>> function or into c-init-language-vars-for, but in order to allow use= rs >>>> to customize cc-mode syntax, we have to be able to recompute languag= e >>>> constants and variables at runtime. >=20 >>> Do we, now? You can imagine I've one or two reservations about this >>> idea.=20 >=20 >> What's your alternative? >=20 > Turning the pertinent c-lang-defvars, and only these, into configurable= > variables in cc-vars.el. Have you looked into what task actually involves? You need to modify c-decl-hangon-kwds, and as a result, c-prefix-spec-kwds, c-postfix-spec-kwds, c-keywords, c-keywords-regexp, c-keywords-obarray, c-nonlabel-token-key, and c-regular-keywords-regexp. It's easier and more flexible to simply allow the entire set of c-lang-defconst values to change. You also have to recompute the font-lock matchers, which is similarly involved. You claim that there is a great risk of negative side effects resulting from this change. I don't agree, and I don't see anyone else proposing, much less implementing, a solution to this problem, and cc-mode's being developed outside the tree makes it frustratingly slow and difficult to get much-needed fixes into core where users can see them. > As I said, I'm not at all happy at making such a massive change to CC > Mode's architecture. There would surely be unforeseen consequences, so= me > of which might well be negative. It's not a massive change in architecture. cc-mode can already evaluate these variables at runtime in the case of a version mismatch. I propose simply doing so all the time. My timing indicates that it's not a performance problem in practice. --3dKDO00V0eowQHqj2TUuFoqErGjLkPA8x 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTdlOgAAoJEMAaIROpHW7IPrYQAJJbkZLXMRR0biRiMkAvKhsw 6cNcReREMLBh/2UH5+fseQoZbnLoGwY7Zxk3TIPUfTQ4XhPiRIEJ7AX+GBrvOeIq Fxqg3abt6uFkW9FInd5BZ0DlY/9wverpdIeasqETL3qO6VwTeP4Xre0pg1Rmo8kG Ny/jqoLjpJqwrJ7s9FY0YYs3q07lZjsOtB8XhdKmfiKjoeAVFvTB2vGEsFeBjSVq FgfeeM3ovNci3RUltZ3W+rhddgjjsB/roqvAMni+eYe21zTxdWoWbMOSnCeNpmKo FwgAfn+YXDO2FE2sN6rjufKBCfs4uPNJsWxEaXTNp4yOgcU5hxkRoOxK2uLUr2oV qW65JWjHNWWvG7jyy7DSM+xzDyYPBibaU7XKRZihDEa4sjDMVaL6Ty7URXU+T0mA auQ+zJqXiR0/6i0wOD9VG5GpMMF4U8QSF7zyAdGke1dugp2KkYzNjU84N8qdvlhn ihmi3VFyO9gr5//jaLi+aE/0ybnqTfimJ61UYfIbjpKkZog4NlJNuYq7HjUWrrd1 xVDzTDh/dxVxQsqHWOT1rZdyBbfezDhEd/JXi/ECGBURXyLpEpea81GWLPqBiAUu +9FvAbbxhXoDra284aNLiq6o2EkTcfTPZc8AgS1RU98zczu8UM7aX6LTj6kf5EPR eRi8hY3CKNpqDs8ePE+H =iT1K -----END PGP SIGNATURE----- --3dKDO00V0eowQHqj2TUuFoqErGjLkPA8x--