From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#41195: 27.0.91; Using syntax-ppss-flush-cache in syntax-propertize-function infloops Date: Tue, 12 May 2020 02:32:37 +0300 Message-ID: <1d616b0d-3e1b-5f72-da35-d0aa056322b4@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="90555"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 To: 41195@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 12 01:33:11 2020 Return-path: Envelope-to: geb-bug-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 1jYHv3-000NQ5-Nt for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 May 2020 01:33:09 +0200 Original-Received: from localhost ([::1]:47080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYHv2-0001nA-Cg for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 May 2020 19:33:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYHuw-0001n2-RD for bug-gnu-emacs@gnu.org; Mon, 11 May 2020 19:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYHuw-0000X5-I9 for bug-gnu-emacs@gnu.org; Mon, 11 May 2020 19:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYHuw-00076w-Eu for bug-gnu-emacs@gnu.org; Mon, 11 May 2020 19:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 May 2020 23:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41195 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158923996527301 (code B ref -1); Mon, 11 May 2020 23:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 May 2020 23:32:45 +0000 Original-Received: from localhost ([127.0.0.1]:53627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYHue-00076H-WD for submit@debbugs.gnu.org; Mon, 11 May 2020 19:32:45 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYHuc-000769-M4 for submit@debbugs.gnu.org; Mon, 11 May 2020 19:32:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYHuc-0001mf-Fu for bug-gnu-emacs@gnu.org; Mon, 11 May 2020 19:32:42 -0400 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:52570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYHub-0000RD-NE for bug-gnu-emacs@gnu.org; Mon, 11 May 2020 19:32:42 -0400 Original-Received: by mail-wm1-x32b.google.com with SMTP id m24so10192443wml.2 for ; Mon, 11 May 2020 16:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:subject:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=dUbJSVsBUVdZkD0KJjJshiST3eBdwcVi8hF8Edb2n8s=; b=Qd+hbMV+nDklfsoSg4zMB/YcdPYTD5NlFrzF082IFvES+an1vbBJzWs17HmK621N+K 8+aHW94jJmgZbO2m2/9BTKgqfTzNufxLitMVRjTGoui06dPv1GO89nBCFDT/oaDff9RF +X1d5cfuaGvy8GEeDmrtmGgjDgpn6X6Acgk/+KVSiTZEWiKbSNK/QauHattEI5Kh+ZMJ JaJWGfEgDILahblETU33JPdguB9Jix4lu3jQdK07JqKG52q/a/kl7h4XySlkt0NXSPQs /v2/u3MeUjs/ekcjGh9DvQp9LruJ4hrVVyFLVhw5Ka9/h2MLxYbr3J+Bv3dCKycmQfi2 cTSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:subject:from:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=dUbJSVsBUVdZkD0KJjJshiST3eBdwcVi8hF8Edb2n8s=; b=C2d7AwBm7ZP0OnliKNS3poSvYqGJPNgqPEJig7qSjYj6aGeLfkpqaENOZnFK0RoYHu Q4KWvQ8zvOzSMjw2bkgi9dfdOJi3fSA8M5xgC5rYnp/FGrM1yNwZ/qPZq2llYPlfZchF ljsH9nMuCGNQws2NlBY1ySmfOfjzSryOiDOdIa5OUlnE5ywbkDl5KQUy0OmfRp0AYtUm GwTCZs2VpPopeMAneXvlQwFl3pwTJQHnzoFsipEpmb0siIvqR6vS5I8hmvDcFT3LRfdk YrhZdsQSEziMEgVqow4IDPab+UrALDnsJd1l/T8BrEJ58MFs+PYnLpFqLoufl8uUIWdV L2NQ== X-Gm-Message-State: AGi0Puax4gbXiemAD/Mki6t71ek4OIBbnRXiHrRNojqI9V9e0n/b/6j+ qJklne648VODPEeTC+M94ExxIH7f X-Google-Smtp-Source: APiQypJXC9VNUnMqVhOi0pFCn3Et0fe/dHT0HNYDdJkkojggw1UVJW+R7vo+91vByUlcgbTzftFFLA== X-Received: by 2002:a1c:f012:: with SMTP id a18mr32950324wmb.41.1589239959366; Mon, 11 May 2020 16:32:39 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id d9sm4579594wmd.10.2020.05.11.16.32.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2020 16:32:38 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180086 Archived-At: In theory, syntax-propertize-function implementations shouldn't change buffer syntax the way that would affect the current syntax-ppss cache. Or if they do, they should clear the cache accordingly. Unfortunately, using syntax-ppss-flush-cache for that purpose doesn't work: it makes Emacs infloop. To reproduce, apply this patch: diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 5ec3e94275..efe38049ab 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -2362,6 +2362,7 @@ js-syntax-propertize (eval-when-compile (append "=({[,:;" '(nil)))))) (put-text-property (match-beginning 1) (match-end 1) 'syntax-table (string-to-syntax "\"/")) + (syntax-ppss-flush-cache (match-beginning 0)) (js-syntax-propertize-regexp end))))) ("\`\(#\)!" (1 "< b")) ("<" (0 (ignore and then edit a file with js-mode containing a = /xyz/