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.

Full log


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)]

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

Previous Next


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