From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: font-lock-syntactic-keywords obsolet? Date: Mon, 20 Jun 2016 00:33:20 -0400 Message-ID: References: <20160618171249.GA5796@acm.fritz.box> <20160619133143.GA5875@acm.fritz.box> <20160619145934.GC5875@acm.fritz.box> <6bc7b3bc-ddb7-c041-9f68-f8b5faeca63b@yandex.ru> <20160619151836.GE5875@acm.fritz.box> <1d4c62e6-905b-4a51-28b8-e68169fb3269@yandex.ru> <20160619153455.GG5875@acm.fritz.box> <11c988f0-94c0-40dd-b9cd-5a5e27028b63@yandex.ru> <20160619171531.GH5875@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466397259 1409 80.91.229.3 (20 Jun 2016 04:34:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2016 04:34:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 20 06:34:10 2016 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 1bEquX-0000x5-D8 for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2016 06:34:09 +0200 Original-Received: from localhost ([::1]:41208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEquW-0005P0-Bc for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2016 00:34:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEqtz-0005Oi-Dh for emacs-devel@gnu.org; Mon, 20 Jun 2016 00:33:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEqtv-00026q-9d for emacs-devel@gnu.org; Mon, 20 Jun 2016 00:33:34 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:54255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEqtv-00026k-3j for emacs-devel@gnu.org; Mon, 20 Jun 2016 00:33:31 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bEqts-0000TA-D2 for emacs-devel@gnu.org; Mon, 20 Jun 2016 06:33:28 +0200 Original-Received: from 45.72.244.67 ([45.72.244.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Jun 2016 06:33:28 +0200 Original-Received: from monnier by 45.72.244.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Jun 2016 06:33:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 45.72.244.67 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:lyivMGA6BoWAlHaxH3LZEjtjYso= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:204566 Archived-At: > Changing CC Mode to use syntax-propertize-function would require a > substantial amount of design work, assuming such were possible. Actually, my experience with changing existing major modes to use syntax-propertize is that there really isn't any need for a big redesign. That includes non-trivial cases such as cperl-mode and nxml-mode. So far, CC-mode has proved too impenetrable for my motivation [and your constant rejection of any patch which aligns CC-mode with "all other major mode" without also fixing a known bug doesn't help of course], but it really usually boils down to finding those parts of the code which apply `syntax-table', calling them from a new foo-syntax-propertize function, and then finding those spots in the code that need `syntax-table' to be applied, and adding calls to `syntax-propertize' there (if any). And then, performing tests to weed out the problems caused by the fact that I really had no clue about what the code was doing. In the case of CC-mode, this would result in losing the benefits of your efforts to try and avoid unnecessary re-scans, but syntax-propertize's laziness should hopefully make up for it. > There doesn't seem to be a good reason to do this. Admittedly, from the point of view of someone who only maintains CC-mode, the benefits are probably slim (tho I'm pretty sure the result would be easier to maintain in the long run). But from the point of view of Emacs, there are some good reasons to try and unify the way different major modes work. E.g. so that there's a standard agreed upon way for a package to know if point is inside a comment, without having to know anything about the current major mode. [ FWIW, CC-mode already interacts well enough with syntax-ppss that this particular need already works OK. ] Stefan