From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: font-lock-syntactic-keywords obsolet? Date: Mon, 20 Jun 2016 20:08:31 +0000 Message-ID: <20160620200830.GE2192@acm.fritz.box> References: <20160619153455.GG5875@acm.fritz.box> <11c988f0-94c0-40dd-b9cd-5a5e27028b63@yandex.ru> <20160619171531.GH5875@acm.fritz.box> <751427e7-f305-7790-99f5-dea230d8e6c4@yandex.ru> <20160620105850.GB3166@acm.fritz.box> <23d7473e-50da-b6dc-17a7-1fec4aad6bfa@yandex.ru> <20160620152535.GB2192@acm.fritz.box> <076b7311-ad16-4913-b0ec-fc73ea4550a1@yandex.ru> <20160620181218.GC2192@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1466453359 30168 80.91.229.3 (20 Jun 2016 20:09:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2016 20:09:19 +0000 (UTC) Cc: emacs-devel@gnu.org, Noam Postavsky To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 20 22:09:07 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 1bF5VF-0006YX-MF for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2016 22:09:01 +0200 Original-Received: from localhost ([::1]:46204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF5VB-0002CE-KC for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2016 16:08:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF5Uf-0002Bw-Ic for emacs-devel@gnu.org; Mon, 20 Jun 2016 16:08:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF5Ua-0001oV-HS for emacs-devel@gnu.org; Mon, 20 Jun 2016 16:08:25 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:23540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF5Ua-0001nF-7P for emacs-devel@gnu.org; Mon, 20 Jun 2016 16:08:20 -0400 Original-Received: (qmail 29937 invoked by uid 3782); 20 Jun 2016 20:08:18 -0000 Original-Received: from acm.muc.de (p548C7218.dip0.t-ipconnect.de [84.140.114.24]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 20 Jun 2016 22:08:16 +0200 Original-Received: (qmail 13217 invoked by uid 1000); 20 Jun 2016 20:08:31 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.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:204609 Archived-At: Hello, Dmitry. On Mon, Jun 20, 2016 at 10:15:58PM +0300, Dmitry Gutov wrote: > On 06/20/2016 09:12 PM, Alan Mackenzie wrote: [ .... ] > >> - Double-quoted strings are allowed to span multiple lines. > >> - Syntax is complex enough that we need to use the syntax-table property. > >> - Whether a character gets a syntax-property applied, depends on whether > >> it's inside a string or comment, among other things. > > All of these 3 criteria apply to C++ Mode, yet there's no need for lazy > > syntax-table propertification there. > Please give an example of syntax-property application in C++ Mode that > only happens inside a string. And another, which only happens outside of > strings, if there are any. The criterion was "... whether it's inside a string or commont, among other things.". There are syntax-table uses in "other things", namely macros. For example, in #error don't panic! the "'" gets punctuation syntax, but wouldn't outside of the macro. C++ template delimiters (and the like in Java) get parenthesis syntax in code, but not when in a string. > > Another question for you. Under the aforementioned laziness, how and > > when do syntax-table properties get modified after a buffer change when > > these s-t properties are _above_ the position of the change in the buffer? > Stefan already addressed that: > http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00421.html He sort of addressed it. The code which implements syntax-propertize-extend-region-functions is not fully general. For the general case, you'd need to supplement such a function with a mode specific before-change function. And if you've got to do that, you might as well just finish the job off and write an after-change function and bypass the complexity of syntax-propertize-extend-region-functions entirely. > But like he said, normally, you just don't. He's wrong. You have, say, in C++ "a < b, c > d", which has been given s-t properties as a template. You insert "=" after ">". That necessitates de-propertising the "<" as well as the ">". > It's rare to have the syntactic meaning of a construct change based on > text several lines down from it. Or even just one line. It happens regularly. Or, at least, often enough that it's got to be dealt with, particularly with C++ template delimiters. > > I can argue that because they're clean, well understood abstractions. > > And I do argue that b/a-c-f are a good way of manipulating s-t properties > > when these properties are "local". > b/a-c-f are handy when things are easy? > Thanks! That's helpful. They're handy in the usual case. > > Oh, I'm pretty "educated" about syntax-ppss, thank you very much - > > educated enough to submit bug reports about it. > Just one, and you like reminding us about it every chance you can. I'm hoping that, by doing so, it'll get fixed by somebody who isn't me, given how much I dislike the function. Please do fix it, like you suggested somewhere else today. > > But I was hoping you > > could tell me something more about non-"local" s-t properties. > What's that? Properties can't be non-local. They are just values you put > on a piece of buffer text. . The meaning we've already established over several posts is syntax-table text properties whose setting, or lack thereof, is influenced by arbitrarily distant text in the buffer. You have asserted that there exist such text properties in Ruby Mode. > Please ask a specific question. > > And it's a good reason not to use syntax-propertize when all s-t > > properties are, in fact "local", and it is desirable for these properties > > to be amended instantly on buffer changes. > Meaning, never? My meaning's clear enough. Good night! -- Alan Mackenzie (Nuremberg, Germany).