GNU bug report logs - #45114
perl-mode warns about mismatched parentheses wrongly

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Tue, 8 Dec 2020 05:46:01 UTC

Severity: minor

Tags: confirmed

Merged with 24299

Found in version 26.2

To reply to this bug, email your comments to 45114 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 05:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 08 Dec 2020 05:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: perl-mode warns about mismatched parentheses wrongly
Date: Tue, 08 Dec 2020 13:45:03 +0800
$ emacs file.pl # and start typing
if(/^[^}]/) ...

During the process you will get spurious warnings about mismatched
parentheses etc.

emacs-version "27.1"




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 06:24:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>,
 45114 <at> debbugs.gnu.org
Subject: Re: bug#45114: perl-mode warns about mismatched parentheses wrongly
Date: Tue, 08 Dec 2020 08:23:25 +0200
On December 8, 2020 7:45:03 AM GMT+02:00, "積丹尼 Dan Jacobson" <jidanni <at> jidanni.org> wrote:
> $ emacs file.pl # and start typing
> if(/^[^}]/) ...
> 
> During the process you will get spurious warnings about mismatched
> parentheses etc.
> 
> emacs-version "27.1"

This is a well documented feature.  If you don't like it, turn off blink-matching-paren.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 06:24:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 06:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 45114 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 45114 <at> debbugs.gnu.org
Subject: Re: bug#45114: perl-mode warns about mismatched parentheses wrongly
Date: Tue, 08 Dec 2020 14:38:25 +0800
>>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:

EZ> This is a well documented feature.  If you don't like it, turn off blink-matching-paren.

But that would ruin it outside of regular expressions too.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 07:05:01 GMT) Full text and rfc822 format available.

Message #17 received at 45114 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 45114 <at> debbugs.gnu.org
Subject: Re: bug#45114: perl-mode warns about mismatched parentheses wrongly
Date: Tue, 08 Dec 2020 09:04:37 +0200
On December 8, 2020 8:38:25 AM GMT+02:00, "積丹尼 Dan Jacobson" <jidanni <at> jidanni.org> wrote:
> >>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> EZ> This is a well documented feature.  If you don't like it, turn off
> blink-matching-paren.
> 
> But that would ruin it outside of regular expressions too.

I see nothing special about regular expressions in this context.  Parens matching is useful there as well as anywhere else.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 07:11:02 GMT) Full text and rfc822 format available.

Message #20 received at 45114 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 45114 <at> debbugs.gnu.org
Subject: Re: bug#45114: perl-mode warns about mismatched parentheses wrongly
Date: Tue, 08 Dec 2020 15:09:51 +0800
>>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
EZ> I see nothing special about regular expressions in this context.  Parens matching is useful there as well as anywhere else.

/[

means we are entering characters that stand on their own, that _should
not be thought to match_ previous characters.

As I am entering the regexp, emacs should not tell me that

/[}

is wrong.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 07:15:01 GMT) Full text and rfc822 format available.

Message #23 received at 45114 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 45114 <at> debbugs.gnu.org
Subject: Re: bug#45114: perl-mode warns about mismatched parentheses wrongly
Date: Tue, 08 Dec 2020 09:14:43 +0200
On December 8, 2020 9:09:51 AM GMT+02:00, "積丹尼 Dan Jacobson" <jidanni <at> jidanni.org> wrote:
> >>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
> EZ> I see nothing special about regular expressions in this context. 
> Parens matching is useful there as well as anywhere else.
> 
> /[
> 
> means we are entering characters that stand on their own, that _should
> not be thought to match_ previous characters.
> 
> As I am entering the regexp, emacs should not tell me that
> 
> /[}
> 
> is wrong.

I disagree.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 11:15:02 GMT) Full text and rfc822 format available.

Message #26 received at 45114 <at> debbugs.gnu.org (full text, mbox):

From: haj <at> posteo.de (Harald Jörg)
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45114 <at> debbugs.gnu.org
Subject: Re: bug#45114: perl-mode warns about mismatched parentheses wrongly
Date: Tue, 08 Dec 2020 12:13:47 +0100
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> $ emacs file.pl # and start typing
> if(/^[^}]/) ...
>
> During the process you will get spurious warnings about mismatched
> parentheses etc.
>
> emacs-version "27.1"

This is a general Emacs-ism: The warning appears in any mode, not just
in Perl mode.  So, in any environment of Perl mode: in code, but also in
strings, comments, and POD - and in character classes of a regex.
Whenever you type [}, the warning will appear (also in Gnus' message
mode, as I just experienced).

The current message texts "Mismatched parentheses" and "No matching
parenthesis found" _look_ pretty much like error messages from a
compiler, or from a syntax-aware programming mode. They always make me
wince.

I suggest to change the message texts to clarify that no effort was
taken to find out whether the mismatch is significant, like this:

   Note: no matching paren shown

Would that be acceptable?

I guess this bug can be merged with Bug#24299?
-- 
Cheers,
haj




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45114; Package emacs. (Tue, 08 Dec 2020 12:04:01 GMT) Full text and rfc822 format available.

Message #29 received at 45114 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Harald Jörg <haj <at> posteo.de>, 
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 45114 <at> debbugs.gnu.org
Subject: Re: bug#45114: perl-mode warns about mismatched parentheses wrongly
Date: Tue, 8 Dec 2020 06:03:01 -0600
forcemerge 24299 45114
thanks

haj <at> posteo.de (Harald Jörg) writes:

> I guess this bug can be merged with Bug#24299?

Yes, done.




Forcibly Merged 24299 45114. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 08 Dec 2020 12:04:02 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.