From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#30393: 24.4; cperl-mode: indentation failure Date: Sun, 11 Feb 2018 17:53:38 -0500 Message-ID: References: <20180208152552.GL13340@hodi> <20180209175040.63536.qmail@mail.muc.de> <3331f80a-c5aa-5cb9-8088-0a88888bdaca@yandex.ru> <20180210112654.GA4537@ACM> <20180211103610.GA4515@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1518389620 11658 195.159.176.226 (11 Feb 2018 22:53:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Feb 2018 22:53:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 30393@debbugs.gnu.org, Dmitry Gutov , Noam Postavsky To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 11 23:53:36 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1el0Ur-0001mj-RX for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Feb 2018 23:53:21 +0100 Original-Received: from localhost ([::1]:37534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1el0Wt-0007pD-7Z for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Feb 2018 17:55:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1el0W2-0007Wh-V3 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 17:55:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1el0VX-0000NW-1C for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 17:54:34 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1el0VW-0000Mg-M8 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 17:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1el0VW-0003LK-Ct for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 17:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2018 22:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30393 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30393-submit@debbugs.gnu.org id=B30393.151838962412826 (code B ref 30393); Sun, 11 Feb 2018 22:54:02 +0000 Original-Received: (at 30393) by debbugs.gnu.org; 11 Feb 2018 22:53:44 +0000 Original-Received: from localhost ([127.0.0.1]:38696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1el0VE-0003Ko-DQ for submit@debbugs.gnu.org; Sun, 11 Feb 2018 17:53:44 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:33904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1el0VC-0003Kg-CM for 30393@debbugs.gnu.org; Sun, 11 Feb 2018 17:53:43 -0500 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w1BMrd8c026305; Sun, 11 Feb 2018 17:53:39 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 8788B6630B; Sun, 11 Feb 2018 17:53:38 -0500 (EST) In-Reply-To: <20180211103610.GA4515@ACM> (Alan Mackenzie's message of "Sun, 11 Feb 2018 10:36:10 +0000") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6219=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6219> : inlines <6389> : streams <1778709> : uri <2591122> 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: 208.118.235.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:143179 Archived-At: > OK, but I suspect in practice, this would be impossible to debug for > lack of reproducibility. Those problems can be hard to debug, indeed. But an inf-loop should at least be diagnosed as such fairly easily (even if its origin can be difficult to track down), so I don't think "in practice I haven't bumped into this problem yet" just because those problems stay undetected. > Another definite bug is that the syntax-ppss cache is not flushed when > the syntax-table is changed, whether with set-syntax-table or > modify-syntax-entry. That's right. I haven't bumped into such issues yet, but here (contrary to the above problem) it might very well be because the error stays undetected. > This is critical, now that primitives depend on this cache. I can see two approaches to solve this problem: - hook into set-syntax-table and modify-syntax-entry or something like that. This will make it work right everywhere automatically, but I'm afraid it could turn out to be difficult to make it efficient (because of the cost of the tests needed to detect changes and more importantly because of excessive flushing of the syntax-ppss cache). - provide new functions to let packages tell syntax-ppss about such things. E.g. a macro `with-new-syntax-context` (which would be treated a bit like narrowing, maybe). This would require changes to packages that suffer from this problem but should give better performance. I'd prefer the second option, but at the same time, I'm not completely sure what are the "typical" problem cases (which makes it hard to come up with good new functions/macros) other than the case where we use with-syntax-table (which is sometimes combined with a local narrowing) but some of those only tweak the "word-vs-symbol-vs-punctuation" settings so should ideally not flush the syntax-ppss cache. Also I don't actually know whether the "fully automatic" approach would actually turn out to be too expensive, it's just a gut feeling. > Would you please fix this, Stefan. It's fairly high up on my todo list, but I'm kinda swamped right now. Stefan