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: Tue, 04 Jun 2019 09:08:53 -0400 Message-ID: References: <87ef4awyb6.fsf@gmail.com> <87sgsqwjxp.fsf@gmail.com> <87o93dx5lp.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="52910"; 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 Tue Jun 04 15:10:32 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 1hY9Cx-000DcZ-D6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Jun 2019 15:10:31 +0200 Original-Received: from localhost ([127.0.0.1]:52460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hY9Cw-0007Mm-A2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Jun 2019 09:10:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hY9CV-0007BJ-9F for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2019 09:10:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hY9CU-0004PM-CE for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2019 09:10:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58950) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hY9CU-0004Ot-6R for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2019 09:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hY9CU-0005VU-0O for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2019 09:10: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: Tue, 04 Jun 2019 13:10: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.155965375321107 (code B ref 24749); Tue, 04 Jun 2019 13:10:01 +0000 Original-Received: (at 24749) by debbugs.gnu.org; 4 Jun 2019 13:09:13 +0000 Original-Received: from localhost ([127.0.0.1]:44261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hY9Bh-0005UN-Bg for submit@debbugs.gnu.org; Tue, 04 Jun 2019 09:09:13 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hY9Be-0005U6-LO for 24749@debbugs.gnu.org; Tue, 04 Jun 2019 09:09:11 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 129BE101278; Tue, 4 Jun 2019 09:09:04 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 88C321011A3; Tue, 4 Jun 2019 09:09:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1559653742; bh=engmayR51um/UXolTO15rIMryKzLI9MDlIoJyZeOvEg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=DKpHzYDI+X8FzP3l6Sx2GY8q1sehg7LazB44+p2p4nIIBRv7KwnZ7qlu8gHM3mxHx gP9NyG6/wUZq6kOsvWJlD3AQzereHIxIIMB09bJ0IP349TdQE2hqeRWmA+d2XN7L+Q 6NqWKASmEq0mX13S/nn3iQr3+1M2+Ut4P3GebHOhsEqremV4HPJSpGX9jWAz4mXv5G 4O1VsO8i/+WC4TuK5sIPjtAHsT3HL2DOeudNgx0No1Ry53aRK7qO74QF7E50e7ccJi /rddM6OYMhCRl6o/dxMl3BRI0EW65ya+b+L4YB9Idrz+3FGS2IrYRZPn+e7CEx4fPr CiEPHqLBbwUgQ== Original-Received: from pastel (unknown [45.72.167.35]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 59AD7120B76; Tue, 4 Jun 2019 09:09:02 -0400 (EDT) In-Reply-To: <87o93dx5lp.fsf@gmail.com> (Vitalie Spinu's message of "Tue, 04 Jun 2019 07:49:22 +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:160105 Archived-At: > Arh. Right. It's a chicken-egg then, syntax-propertize is triggered by > search when parse-sexp-lookup-properties are t, but > parse-sexp-lookup-properties is set by syntax-propertize. So an > external tool (font-lock) was needed to syntax-propertize for the > first time before this patch. Things are not particularly elegant, > are they? I see you understand ;-) > Would you consider a patch which sets it to t by default and removes the > auto-resets? It's hard to imagine that it would break anything. It's not my call to make, but I won't oppose it, no. > Ok, but then setting parse-sexp-lookup-properties to t by default > would not harm such a mode. No, and I can't think of a case where it would cause harm other than maybe a potential possible slowdown. > I am setting it to nil while searching for mode boundaries in > polymode. First, it doesn't make sense to use local syntax tables in > search because different inner modes might have a different opinion of > syntax. That also means that the regexps you use there presumably don't use syntax-dependent constructs like \s?, \<, and friends, right? > Second, I don't want to trigger syntax-propertize for > performance reasons. The bounds of the forward search is normally eob > and that would mean syntax-propertizing the entire buffer on every > mode boundary lookup. If your regexp doesn't use syntax-dependent constructs, then the regexp search shouldn't call syntax-propertize, IIRC (and similarly, syntax-propertize wouldn't be applied to the whole buffer if a match is found before EOB). Stefan