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: Clarification needed: syntax-propertize vs font-lock-syntax-table Date: Wed, 18 Nov 2015 18:06:53 +0000 Message-ID: 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 1447871264 7098 80.91.229.3 (18 Nov 2015 18:27:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2015 18:27:44 +0000 (UTC) To: "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 18 19:27:39 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 1Zz7SE-0005wJ-DS for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2015 19:27:38 +0100 Original-Received: from localhost ([::1]:37526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz7SD-0004et-Kx for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2015 13:27:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz7Rz-0004eH-3D for emacs-devel@gnu.org; Wed, 18 Nov 2015 13:27:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz7Ru-0002tu-5I for emacs-devel@gnu.org; Wed, 18 Nov 2015 13:27:23 -0500 Original-Received: from smtpgw04.sap-ag.de ([155.56.66.99]:50126 helo=smtpgw.sap-ag.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz7Rt-0002th-VK for emacs-devel@gnu.org; Wed, 18 Nov 2015 13:27:18 -0500 Thread-Topic: Clarification needed: syntax-propertize vs font-lock-syntax-table Thread-Index: AdEiK797Zfv0vIqNQrCiB+oo5A0cIw== 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:194735 Archived-At: The function `syntax-propertize' sets the syntax-table properties which shadow the definition from the current syntax-table. This function calls the function in syntax-propertize-function whose docstring explicitly allows to call `syntax-ppss'. For this to work consistently, it is necessary that `syntax-propertize' is called with the same (or very similar) syntax-table, at least for the same buffer areas. (Yes, I see the Todo at the beginning of syntax.el) Or do I miss something? The most prominent call of `syntax-propertize' is inside font-lock, where the `font-lock-syntax-table' is active. But there are also many valid calls of this function (most via `syntax-ppss') where the standard (syntax-table) is active. (And there are missing calls - hello imenu.el) What does this mean? To be consistent, ... * Solution 1: the font-lock syntax table must not differ too much from the normal syntax table, i.e., the function in syntax-propertize-function should behave the same. If so, it should be probably documented. * Solution 2: there is a local variable for an extra syntax table for `syntax-propertize' Any other ideas? With Solution 1, it would be excellent if the (nth 9 ppss), parse-partial-sexp, would be made official. Otherwise, the multi-mode check in antlr-mode.el (are we in the action of a grammar?) could not rely on (nth 0 ppss) anymore... - Christoph