GNU bug report logs - #26850
perl-mode: apostrophes trigger color change in wrong situation

Previous Next

Package: emacs;

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

Date: Tue, 9 May 2017 05:44:01 UTC

Severity: minor

Tags: confirmed, fixed

Merged with 26745

Found in versions 27.0.50, 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26850 in the body.
You can then email your comments to 26850 AT debbugs.gnu.org in the normal way.

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#26850; Package emacs. (Tue, 09 May 2017 05:44:01 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, 09 May 2017 05:44: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 <bug-gnu-emacs <at> gnu.org>
Subject: perl-mode: apostrophes trigger color change in wrong situation
Date: Tue, 09 May 2017 06:50:40 +0800
Apostrophes trigger color change in wrong situation:

sub interesting {
    $_ = shift;
    return
         />Today is .+'s birthday\.</
      || / like[ds]? your post in </
      || /like[ds] your new subscription\. </
      || / likes? that you're interested in </
      || /> likes? your comment: /
      || /&amp;birthdays=.*birthdays?\.<\/a>/;
}




Merged 997 26850. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 09 Jul 2017 18:51:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sat, 29 Feb 2020 02:59:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 28.0.50. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sat, 29 Feb 2020 02:59:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26850; Package emacs. (Mon, 16 Nov 2020 22:14:01 GMT) Full text and rfc822 format available.

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

From: haj <at> posteo.de (Harald Jörg)
To: 26850 <at> debbugs.gnu.org
Subject: perl-mode and cperl-mode: Recognize regex after "return"
Date: Mon, 16 Nov 2020 23:13:16 +0100
[Message part 1 (text/plain, inline)]
merge 26850 26745
thanks

I don't know whether I have the authority to merge bugs, but they
clearly are the same issue, so I'll just give it a try.

The apostrophe, as mentioned in the subject of Bug#26850, is irrelevant:
The actual problem in both reports is the failure to recognize a regular
expression after the keyword "return".  The apostrophe just changes the
interpretation of the text which follows.

There are several workarounds: You could, for example, explicitly write
the regexes as $_ =~ /.../; ... but of course, why would you do that,
since $_ is superfluous.  Alternatively, you could just omit the
"return", which is also superfluous in the examples provided.

Nevertheless, the patch fixes the issue, which happens in both perl-mode
and cperl-mode.  I guess that in neither mode the list of keywords which
precede a regex is actually complete, but "return" is a use case
relevant enough to be fixed.
--
Cheers,
haj
[0001-cperl-mode-perl-mode-Recognize-a-regular-expression-.patch (text/x-diff, attachment)]

Forcibly Merged 997 26745 26850. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Nov 2020 23:23:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26850; Package emacs. (Mon, 16 Nov 2020 23:25:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: haj <at> posteo.de (Harald Jörg)
Cc: 26850 <at> debbugs.gnu.org
Subject: Re: bug#26850: perl-mode and cperl-mode: Recognize regex after
 "return"
Date: Tue, 17 Nov 2020 00:24:42 +0100
haj <at> posteo.de (Harald Jörg) writes:

> I don't know whether I have the authority to merge bugs, but they
> clearly are the same issue, so I'll just give it a try.

Oh, sure, I think everybody can.  Hm...  but it doesn't seem to have
gone through in this case?  When the statuses of the bugs involved
aren't the same, you have to use "forcemerge" to make it actually
happened; I did that now.

> There are several workarounds: You could, for example, explicitly write
> the regexes as $_ =~ /.../; ... but of course, why would you do that,
> since $_ is superfluous.  Alternatively, you could just omit the
> "return", which is also superfluous in the examples provided.
>
> Nevertheless, the patch fixes the issue, which happens in both perl-mode
> and cperl-mode.  I guess that in neither mode the list of keywords which
> precede a regex is actually complete, but "return" is a use case
> relevant enough to be fixed.

Thanks for the patch; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Nov 2020 23:26:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 26850 <at> debbugs.gnu.org and 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Nov 2020 23:26:02 GMT) Full text and rfc822 format available.

Disconnected #997 from all other report(s). Request was from haj <at> posteo.de (Harald Jörg) to control <at> debbugs.gnu.org. (Thu, 19 Nov 2020 17:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 18 Dec 2020 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 129 days ago.

Previous Next


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