GNU bug report logs - #16368
24.3; freeze in cperl mode when editing a regexp

Previous Next

Package: emacs;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Mon, 6 Jan 2014 01:30:02 UTC

Severity: normal

Tags: confirmed, patch

Found in versions 26.1, 24.3

Fixed in version 28.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Harald Jörg <haj <at> posteo.de>
To: Stefan Kangas <stefankangas <at> gmail.com>, 16368 <at> debbugs.gnu.org
Subject: bug#16368: [PATCH] cperl-mode: don't freeze over a cool regexp
Date: Thu, 3 Sep 2020 22:27:12 +0200
[Message part 1 (text/plain, inline)]
On 9/3/20 11:58 AM, Stefan Kangas wrote:
> Harald Jörg <haj <at> posteo.de> writes:
>
>> I'd say this is desired behavior.
>
> OK, thanks.  Your explanation sounds good to me.

It wasn't quite accurate, though.  My explanation assumed that the
regex as a whole wasn't terminated, but in fact it was.  In fact, the
message comes from the fact that (?{...}) introduces a block of code
into the regexp.  So, by removing the colon from (?:{...}), the
semantics changed from "just another shy group" to "code", and for
code cperl-mode applies stricter rules than for the contents of a
capture group.

I'd still say the message is ok.

>> I can only guess that the first part of the message (which starts with
>> "cperl-forward-group-in-re") was added out of frustration: The bug
>> prevented the second part of the message (without
>> "cperl-forward-group-in-re") from ever appearing.  Only this wasn't
>> fatal unless... there was this closing brace two characters before.
>> I'll check that, and prepare an updated patch if that's true.
>
> Sounds good.

...And done.  Now you get only one message, without the unnecessary
"cperl-forward-group-in-re" prefix.

>> No problem, I'll do so.  I thought I was supposed to create the commit
>> messages with C-x 4 a, but probably I misunderstood and should have
>> post-processed that text in the first place.
>
> I always use C-x 4 a, and then delete the spacing to the left.

Ok, adapted.  I have also used your recommendation for the commit
summary.

>> Hm. That should rather be _moving_ that line to the top?
>
> Ah, right.  Yup, that sounds good.

When I did this, I stumbled over the purpose of Stefan Monniers change
to the tests - this has been taken to emacs-devel.  For now, moving
the line to the top and skipping the test if called in a perl-mode
environment, should do the trick.

Patch, mark2, is attached!
-- 
Cheers,
haj
[0001-Fix-freeze-in-cperl-mode-when-editing-a-regexp.patch (text/x-patch, attachment)]

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

Previous Next


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