From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Giving "text quotes" syntax in font-lock-syntax-table only Date: Tue, 02 Jun 2020 14:46:33 -0400 Message-ID: References: <50114.1589957638@localhost> <55185.1589981051@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="62315"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Ikumi Keita Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 02 20:47:37 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgBwn-000G41-Fg for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Jun 2020 20:47:37 +0200 Original-Received: from localhost ([::1]:37684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgBwm-0005gl-Ht for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Jun 2020 14:47:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgBw0-0005F9-UM for emacs-devel@gnu.org; Tue, 02 Jun 2020 14:46:48 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgBvx-0004yV-95 for emacs-devel@gnu.org; Tue, 02 Jun 2020 14:46:47 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D253F441293; Tue, 2 Jun 2020 14:46:41 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4385E4412B6; Tue, 2 Jun 2020 14:46:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1591123600; bh=I2D4BvTqQbl3UfQJ+jiMVLm8O9NgSCZGmE4zdhEP3yA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ojf++BwUna+DIqVGKMhVq+D/8kNWanv6unSWH00lIbzrWcEo67dQmP1G/FSVDGqn6 PdrmaHXY3+DEO/sWOjx08VWE+O72dNrtw7XSFUH5nnjamkZhoea/+OoYvCa699n6UR Qm23AB4POAQVA7fwY9VdGARvB6SfQH41DOWzYf5GKr3z2s7/ZWmIPWB2TGBMSU7bki TMcPFl5MF1Wtae/LK+A11Jjzn5N4NrZGC5dglj5Y4YS7rwCeWTg1pFwRsUMu4yNkJo MAp32cCaLrzcjIHcQScmb/CT+7BgxVwQhSMzZZV5TBqysaQIC4FDaviKWZHGx91/V4 ecsW93bTj49mQ== Original-Received: from alfajor (76-10-137-254.dsl.teksavvy.com [76.10.137.254]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AAF0B12031C; Tue, 2 Jun 2020 14:46:39 -0400 (EDT) In-Reply-To: <55185.1589981051@localhost> (Ikumi Keita's message of "Wed, 20 May 2020 22:24:11 +0900") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/02 14:46:41 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251778 Archived-At: Sorry for not getting back to you sooner. I see you (plural) decided to switch to highlighting math elements using regexps rather than the syntax-table. That sounds like a wise choice. > This resembles the method to modify the major mode's syntax table > (without setting `syntax-ppss-table'). It does eliminate the wrong > fontification, but brings another problem in actual use cases of AUCTeX. > When `syntax-ppss-table' is non-nil, all functions using `syntax-ppss' > obey that syntax table, so they regard math expression $...$ as string > constant. This can be problematic for cases like this: Indeed. What you could do if you still want to use syntax-tables rather than regexp, is to add an entry to the beginning of `font-lock-keywords` which does the equivalent of `font-lock-fontify-syntactically-region` but without using `syntax-ppss` and using its own syntax-table. Maybe this actually argues that `font-lock-fontify-syntactically-region` should use `font-lock-syntax-table` rather than `syntax-ppss-table` and should refrain from using `syntax-ppss` when that syntax-table is different from that of syntax-ppss. Stefan