From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer? Date: Tue, 05 Oct 2021 15:41:58 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28981"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs To: Pierre Rouleau Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 05 21:43:36 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1mXqLg-0007KX-4Y for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 21:43:36 +0200 Original-Received: from localhost ([::1]:57692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXqLf-00082T-1y for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 15:43:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXqL0-0007AQ-Or for help-gnu-emacs@gnu.org; Tue, 05 Oct 2021 15:42:54 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXqKx-0003XK-34 for help-gnu-emacs@gnu.org; Tue, 05 Oct 2021 15:42:52 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3EF2E4405CC; Tue, 5 Oct 2021 15:42:48 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A7EC544058B; Tue, 5 Oct 2021 15:42:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1633462966; bh=UOW9TbbidbrRcCJNcbklGOJkfhwc+AGjtiiCl7xTKA0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=l15FANhfFt4WetmKJ/H/rwmFZFwgKNV/1jDPQ5zPp+aLlQmktAQymXnSRZOSZ4K6t g1KVciyinugAN4k1dinm2y6AKSY7fqrqZe1AQv5ZsjUMpNYeiGSS30+dpyDNXEyiXO b2bqENZiMztKFQuynv1ZU3v6VVyyHGy5+qgO0A4bzaXm5Ihuy/WxCQpiJaXt7dpctb ifJcnwveFX1I8ii5fVV4hfSKfFSf6gH/zhuYaKJPBL2fs14gVykp1KHfqtnX9wd2g7 Do7ICDalS3Lu04WI06WmyjGaw1CwaOWgf54Ijexcmx2J/kLjBNsG8YpfML98ieHoGJ gwOj9Ucc1W4Tw== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8A96E1201F0; Tue, 5 Oct 2021 15:42:46 -0400 (EDT) In-Reply-To: (Pierre Rouleau's message of "Tue, 5 Oct 2021 11:36:32 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca 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_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133587 Archived-At: >> `setq-local` at the toplevel makes no sense. >> Is it really the code you're using, or are you paraphrasing? > Sorry. I did not provide enough context. > That code is not at top-level; it is being called by the erlang-mode > function. OK, thanks, that makes sense (I just wanted to make sure the problem wasn't some silly misunderstanding). > I won't leave that code there once I understand the behaviour. > I'm just modifying my local copy of erlang.el to > 1) understand that code better > 2) eliminate as many external sources of disruption while I investigate. The code you show seems fine to me except for the `2` which should be a `1` (there is only one subgroup in your second regexp). To debug these things, you can try: - `C-u C-x =` on the char(s) where you expect a syntax-table text property, to check whether it's present or not. - Call `syntax-propertize` by hand in case of doubt. - Trace your rules function. E.g. use (defun my-syntax-propertize (beg end) (funcall (syntax-propertize-rules ("\\(<\\)<" (1 "(>")) (">\\(>\\)" (1 ")<"))) beg end)) [...] (setq-local syntax-propertize-function #'my-syntax-propertize) and then `M-x trace-function RET my-syntax-propertize RET`. Stefan