From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: haj@posteo.de (Harald =?UTF-8?Q?J=C3=B6rg?=) Newsgroups: gmane.emacs.bugs Subject: bug#37127: [PATCH] cperl-mode: Suppress a misleading message Date: Sat, 31 Oct 2020 02:09:45 +0100 Message-ID: <87tuubciau.fsf@hajtower> References: <87ftlu67cy.fsf@vinc17.net> <87eelg3ffl.fsf@hajtower> <87zh43cvqa.fsf@hajtower> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2116"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 37127@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 31 02:10:14 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 1kYfPK-0000RE-78 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Oct 2020 02:10:14 +0100 Original-Received: from localhost ([::1]:47926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYfPI-000467-Ow for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 21:10:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYfP8-00045o-Mg for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 21:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYfP8-0007oh-DU for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 21:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYfP8-0007Uo-70 for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 21:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: haj@posteo.de (Harald =?UTF-8?Q?J=C3=B6rg?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Oct 2020 01:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37127 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed fixed Original-Received: via spool by 37127-submit@debbugs.gnu.org id=B37127.160410659628799 (code B ref 37127); Sat, 31 Oct 2020 01:10:02 +0000 Original-Received: (at 37127) by debbugs.gnu.org; 31 Oct 2020 01:09:56 +0000 Original-Received: from localhost ([127.0.0.1]:60210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYfP2-0007UP-0Q for submit@debbugs.gnu.org; Fri, 30 Oct 2020 21:09:56 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:53733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYfOz-0007UA-Lb for 37127@debbugs.gnu.org; Fri, 30 Oct 2020 21:09:54 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 51DAB2400FB for <37127@debbugs.gnu.org>; Sat, 31 Oct 2020 02:09:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1604106587; bh=pDp3jFDqkV4t2vlXXayCv3UfJ8NExa4yPleSjCllX2o=; h=From:To:Cc:Subject:Date:From; b=iYqDKDvQ6IS7qlX/wTjCqtq2+VWHfwM78C+rP200lBo7emMl+3otWIaCWTaKfwVrY PUafYOfvJxBGdZlZV76TTJ7vyWRX0mUUk95yqN3OMTCwJ1htCMPLj6IewgmQduQs08 Y206y76TKdM+ZnggRJveXzy3Y9vLRrqHfU7lTkDRDcVMqEKuFIGFe7dTe1YrcbAxIv UUx4Du05zLy1VpFJBPZWZesUTYoSsHSmLK5lhC2n0Sja5Nq1Mvfkik+U9rM8tQNqrM vR9EQ7JIu+GoL3bIlmzlj6msyA3YzuwO1UO5xyhFaJn1BVq0uV3kcI0Jgfd+JOXdY8 nwbakB9Xgbh6A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4CNLgZ30T4z9rxN; Sat, 31 Oct 2020 02:09:46 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Fri, 30 Oct 2020 18:12:13 -0400") 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:192226 Archived-At: Stefan Monnier writes: >> In an unterminated RE, the message will appear for every single >> character you type, until the RE is terminated. I'd find it odd if the >> `)` was the only character where the message didn't appear :) > > I agree that `)` should be no different. And while as a user I find > such messages more annoying than helpful (I much prefer to be warned by > some font-lock highlighting (e.g. by "bleeding" past what I expected to > be the end) or something like a tooltip), I'm OK with the current > behavior. I just don't think that not emitting the message should > trigger a test failure. I agree. Also, I would be fine with different warning mechanisms, but I guess these need more work (and are not in the scope for the current bug). >> In Perl, almost any non-whitespace character can be used as >> a delimiter, including letters, quotes, comment starters, and colons. > > Yes, I remember that from when I wrote the corresponding > syntax-propertize code for `perl-mode` ;-) > >> I see now that at least this test should be skipped in Perl mode, which >> I failed to do. Again. Sorry for that. > > No problem. > > BTW, I just noticed that if I revert your patch to cperl-mode.el, the > test still succeeds :-( Maybe I should look into that.... When run manually, the symptom is there, in various Emacs versions, and goes away with the patch. Without the patch, the test fails when I run ERT interactively with emacs -Q in Emacs 26.1. It succeeds without the patch when I run ERT in batch :( I know I had several attempts to trick ERT into simulating a closing paren keyboard event, but apparently still failed. I suspect the tests don't make it past The caller of blink-matching-open (blink-paren-post-self-insert-function), which tests for interactive use. Your version calls blink-matching-open directly and avoids that problem. >> In general, handling of REs with non-standard delimiters is one of the >> areas where Perl mode has significant deficiencies. > Hmm... I thought I had managed to make it cover most cases back then. > I'd be interested to know which cases I missed (or which new cases were > introduced since then: after all it was quite some years ago). I'll send that off-list (it has nothing to do with the current bug). > In any case, along the way I decided that this bug was in large part to > blame on blink-matching-open because it calls `syntax-propertize` from > within narrowing. So I changed it which made your `cperl-mode` > patch unnecessary. I also tweaked your test so that it does fail in the > old code (and passes with the new code) and so it also works in > `perl-mode` (except for the second part which I kept but which would > fail in `perl-mode`). This is excellent! I didn't dare to even think about changing this function which apparently works for all other modes, so I tried to work around the issue. > The patch I installed can be found below. Great! Much better now. Many thanks! -- Cheers, haj