bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37127: [PATCH] cperl-mode: Suppress a misleading message


From: Harald Jörg
Subject: bug#37127: [PATCH] cperl-mode: Suppress a misleading message
Date: Thu, 29 Oct 2020 22:11:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

The unjustified message about a missing end of a RE is rather harmless,
it goes away after the next keystroke.  Nevertheless, this can be fixed.
It also happens in several related situations.

The message has its cause in the apparently totally unrelated function
'blink-matching-open'.  Whenever a closing paren is inserted, this
function highlights the corresponding opening paren for a short time.
As part of its processing, it narrows the buffer so that it ends with
the closing paren - thereby excluding the end of the regular expression.

In this state, it calls 'syntax-propertize', which in turn runs through
the cperl-mode functions for syntaxification, ending up eventually in
'cperl-forward-re' - which fails to find the end of the regular
expression in the narrowed buffer.

The patch suppresses the message if the following conditions are met:
   1) The buffer is currently narrowed
   2) We are at the end of the (narrowed) buffer
   3) The error in question is of type 'scan-error

The patch also contains a test to verify that the message isn't written
in the situation given in the bug report, and also that the message is
written if we do indeed have an unterminated regular expression.
--
Cheers,
haj

Attachment: 0001-Suppress-a-misleading-message-when-closing-a-paren-i.patch
Description: Suppress a misleading message


reply via email to

[Prev in Thread] Current Thread [Next in Thread]