From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Clarification needed: syntax-propertize vs font-lock-syntax-table Date: Fri, 20 Nov 2015 20:39:00 +0200 Message-ID: <564F68C4.1020207@yandex.ru> References: <564CC55B.4060102@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1448044757 28095 80.91.229.3 (20 Nov 2015 18:39:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Nov 2015 18:39:17 +0000 (UTC) To: "Wedler, Christoph" , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 20 19:39:15 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 1ZzqaV-0000u7-UK for ged-emacs-devel@m.gmane.org; Fri, 20 Nov 2015 19:39:12 +0100 Original-Received: from localhost ([::1]:49309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzqaV-0000SF-86 for ged-emacs-devel@m.gmane.org; Fri, 20 Nov 2015 13:39:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzqaR-0000Rf-3G for emacs-devel@gnu.org; Fri, 20 Nov 2015 13:39:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzqaN-00023R-UA for emacs-devel@gnu.org; Fri, 20 Nov 2015 13:39:07 -0500 Original-Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzqaN-00023M-NU for emacs-devel@gnu.org; Fri, 20 Nov 2015 13:39:03 -0500 Original-Received: by wmdw130 with SMTP id w130so30382274wmd.0 for ; Fri, 20 Nov 2015 10:39:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=5YQQAKgcpY9ETZfdbfcE58ChXxn25LCAGB8qdU/VKNg=; b=GbOPQ9qrvva2130NbE9MSts5Fzfk/LN70UKXV9GU9/8XgBMBwCRf9ca8Juo/yeZguT Tt7v9AeiYBmtlEf5W2PWkUWGLcGKk8QGwjkVGws3IAw7E1oojkcffaB/NSKkoYHrTW0J MB222dVA5d2WHXYjX6fq/v6Yd2Khvh6PI1ob/VjMTsLonLmvhKl5RAFu3KRuAag1Qcz/ GpZtncAj8lo+GJQGWXwiZ+WhI8Nw6xAc5o0VOqagqmdJn/W7AGa17VfaOBYC7Oslpm/T Q2oPx1zZPMWpetfY4xs+SFwq/pE3AIzT4yprrzGG1y4MHUKC8FOiEXyyAzbm26KAKSDg UTXQ== X-Received: by 10.28.183.215 with SMTP id h206mr1615408wmf.0.1448044742914; Fri, 20 Nov 2015 10:39:02 -0800 (PST) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id a186sm678651wmh.4.2015.11.20.10.39.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Nov 2015 10:39:02 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::22e 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:194874 Archived-At: On 11/20/2015 08:24 PM, Wedler, Christoph wrote: > And syntax-propertize should be called at more places. Currently, doing > it lazily does not really work, as it is not called when needed. You'll have to be more specific. > That > is why js-mode calls (syntax-propertize (point-max)) at the end (and I Not anymore, it doesn't. > will do the same in antlr-mode). I'd prefer if you didn't. > My other question was concerning (nth 9 ppss), i.e. the list of open > parentheses is very useful to have (and its also used in syntax.el > itself) -> I would like to have this to be official in the lisp > docstring as well - in src/syntax.c, we have I thought that's exactly what you meant by documenting the 9th element. Were there any other options? I'm not the guy who can say if it's okay or not. Probably is. But it would be sad if after that we choose a way to adapt syntax-ppss for the multiple-modes case, and it will require saving a more complex structure in the 9th element. > In the case of antlr-mode (grammar with actions), it could be done as > long as it does not break the calulation of the "inner-mode-chunk-end", > e.g, with Python actions > > rule: "KEYWORD" { do_something { } # do it }; > > the action ends with the final "}" (even though a naive Python-like > syntax-propertization would think of it as part of a comment) Yes, of course we should try to make it break as few things as possible. Not sure if I could comment on this in any more detail.