From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Wedler, Christoph" Newsgroups: gmane.emacs.devel Subject: RE: Clarification needed: syntax-propertize vs font-lock-syntax-table Date: Fri, 20 Nov 2015 18:24:34 +0000 Message-ID: References: <564CC55B.4060102@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1448044015 16832 80.91.229.3 (20 Nov 2015 18:26:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Nov 2015 18:26:55 +0000 (UTC) To: Dmitry Gutov , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 20 19:26:55 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 1ZzqOb-0004KG-VD for ged-emacs-devel@m.gmane.org; Fri, 20 Nov 2015 19:26:54 +0100 Original-Received: from localhost ([::1]:49267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzqOb-000410-Bd for ged-emacs-devel@m.gmane.org; Fri, 20 Nov 2015 13:26:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzqMT-0001Yo-9J for emacs-devel@gnu.org; Fri, 20 Nov 2015 13:24:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzqMQ-0006x8-1F for emacs-devel@gnu.org; Fri, 20 Nov 2015 13:24:41 -0500 Original-Received: from smtpgw04.sap-ag.de ([155.56.66.99]:29624 helo=smtpgw.sap-ag.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzqMP-0006wE-Q9 for emacs-devel@gnu.org; Fri, 20 Nov 2015 13:24:37 -0500 Thread-Topic: Clarification needed: syntax-propertize vs font-lock-syntax-table Thread-Index: AQHRIjAlZfv0vIqNQrCiB+oo5A0cI56lN7TQ In-Reply-To: <564CC55B.4060102@yandex.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.21.40.114] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 155.56.66.99 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:194873 Archived-At: > On 11/18/2015 08:06 PM, Wedler, Christoph wrote: >> * Solution 1: the font-lock syntax table must not differ too much from >> the normal syntax table, i.e., the function in > I think this is the current consensus. It shouldn't differ in paren,=20 > comment or string syntax. IOW, it should be syntax-ppss-compatible with=20 > the main one. OK, fine with me. > syntax-propertize-function should behave the same. If so, it should > be probably documented. > It should. And syntax-propertize should be called at more places. Currently, doing it lazily does not really work, as it is not called when needed. That is why js-mode calls (syntax-propertize (point-max)) at the end (and I will do the same in antlr-mode). 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 struct lisp_parse_state { [...] Lisp_Object levelstarts; /* Char numbers of starts-of-expression of levels (starting from outermost). */ }; >> Any other ideas? > Support different syntax tables in different parts of the buffer. That=20 > must be a part of our eventual multi-major-mode solution. 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)