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