From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#24749: Making sure syntax-propertize is called Date: Mon, 03 Jun 2019 15:45:06 -0400 Message-ID: References: <87ef4awyb6.fsf@gmail.com> <87sgsqwjxp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="133114"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 24749@debbugs.gnu.org To: Vitalie Spinu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 03 21:50:34 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXsyX-000YU0-IY for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jun 2019 21:50:34 +0200 Original-Received: from localhost ([127.0.0.1]:40049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXsyW-0002aG-J9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jun 2019 15:50:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXsyK-0002Mz-UL for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2019 15:50:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXsuD-0005WK-L1 for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2019 15:46:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hXsuA-0005QG-7a for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2019 15:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hXsu9-0008WD-Vr for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2019 15:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jun 2019 19:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24749 X-GNU-PR-Package: emacs Original-Received: via spool by 24749-submit@debbugs.gnu.org id=B24749.155959112132694 (code B ref 24749); Mon, 03 Jun 2019 19:46:01 +0000 Original-Received: (at 24749) by debbugs.gnu.org; 3 Jun 2019 19:45:21 +0000 Original-Received: from localhost ([127.0.0.1]:43189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXstV-0008VE-Hl for submit@debbugs.gnu.org; Mon, 03 Jun 2019 15:45:21 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXstR-0008Ut-1U for 24749@debbugs.gnu.org; Mon, 03 Jun 2019 15:45:19 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 47EC48116C; Mon, 3 Jun 2019 15:45:11 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0266A8107A; Mon, 3 Jun 2019 15:45:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1559591110; bh=tjAF8SL46k9JOLK0921xedqF8c3KZlrtneKaB2birbE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=MFAWKNbWCYUB9zJoTrUwtENcnOIPcDBb5j6NPNtp46CRNUz3hj5sr8XcqADrYSaIo PuJ2kg5cN5B1uWgjAxPnvZFUBDekplBcWTMDi13Jhcc1riFUSS6kttNx1WJnvs5Iae xmMkm/XegM3FPZ3+pJxOq9wYT8drZ9huD9R4+WFhW41R0JF7qsYCrhd0VRViPuKgMY ubNkSkqxNSOr1qGgYi4YzXeiByoXbIEI3PfLk0O/c5b3gJUhbeA+tSrr6O00EcWSS+ J9SEXwgZRb6kzbl+uSU939kSEw2PZtyKh71o8RCJqO3q2w4nme8Ua6dYR4alEXJriM 2ejxZXzXl8Pkg== Original-Received: from alfajor (modemcable157.163-203-24.mc.videotron.ca [24.203.163.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BF54A120793; Mon, 3 Jun 2019 15:45:09 -0400 (EDT) In-Reply-To: <87sgsqwjxp.fsf@gmail.com> (Vitalie Spinu's message of "Mon, 03 Jun 2019 21:25:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160086 Archived-At: >> Indeed, font-lock is the most common caller of syntax-propertize, so >> that explains why interactive use typically is not affected. > It's a bit tricky actually. AFAICS font-lock installs it only when > font-lock-syntactic-keywords are defined and syntax-propertize-function is not > defined. No, no: what font-lock does is *call* syntax-propertize. The font-lock-syntactic-keywords stuff is just obsolete backward compatibility cruft. > The latter condition was undefined for me. So I still have no clear > idea what actually is setting the value. It's syntax-propertize which sets parse-sexp-lookup-properties ;-) >> Note: you can also set parse-sexp-lookup-properties's default value to >> t and forget about the problem ;-) > Why not make it the default then? No idea. > There is a clear redundancy between the two. If a mode defines > `syntax-propertize` then it must set `parse-sexp-lookup-properties`, Indeed, which is why syntax-propertize sets it. > and the other way around. Actually the other way around isn't quite true: a major mode may decide to use the syntax-table text-property but set it by hand its own way rather than via syntax-propertize. > It seems that the only(?) use case for a nil `parse-sexp-lookup-properties` is > to set it to nil dynamically in specialized lookup code for performance > reasons. Such code does let-bind it to nil already. I can't remember binding it to nil for performance reasons (tho maybe that's the reason behind yasnippet.el's case), but we do let-bind it temporarily to nil in a few cases as a hackish way to have a "different view" of the buffer which happens to fit our needs. E.g. this is done in font-latex.el and sm-c-mode.el. Stefan