Subject: Re: bug#45114: perl-mode warns about mismatched parentheses wrongly

From: [email-masked] (Harald Jörg)
Date: Tue, 08 Dec 2020 12:13:47 +0100

積丹尼 Dan Jacobson <[email-masked]> 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