GNU bug report logs - #47112
cperl-mode: Wrong highlighting of tr, y, q with _

Previous Next

Package: emacs;

Reported by: "E. Choroba" <choroba <at> matfyz.cz>

Date: Fri, 12 Mar 2021 20:33:02 UTC

Severity: normal

Tags: fixed

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 47112 in the body.
You can then email your comments to 47112 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#47112; Package emacs. (Fri, 12 Mar 2021 20:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "E. Choroba" <choroba <at> matfyz.cz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 12 Mar 2021 20:33:02 GMT) Full text and rfc822 format available.

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

From: "E. Choroba" <choroba <at> matfyz.cz>
To: bug-gnu-emacs <at> gnu.org
Subject: cperl-mode: Wrong highlighting of tr, y, q with _
Date: Fri, 12 Mar 2021 21:31:54 +0100 (CET)
The quote-like operators q, qq, qr, qw, qx, tr, y, m, and s can use word 
characters as quoting characters, but then they must be followed by
whitespace. In Perl, "_" is also a word character, but cperl-mode
doesn't follow this rule. E.g.

sub y_max {

is highlighted as if the y was the transliteration operator, but in
fact "y_max" is a subroutine name, as there's no space after "y".

	Ch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47112; Package emacs. (Sat, 13 Mar 2021 00:28:01 GMT) Full text and rfc822 format available.

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

From: haj <at> posteo.de (Harald Jörg)
To: 47112 <at> debbugs.gnu.org
Subject: Don't interpret '_' as word boundary [PATCH]
Date: Sat, 13 Mar 2021 01:27:16 +0100
[Message part 1 (text/plain, inline)]
This is a border case which affects several dark corners in CPerl mode.
Per default, the '_' character is not a word character, but a symbol
character in Perl.

The bogus regexp in `cperl-find-pods-heres' checks the quote-like things
for "ending in a word boundary".  Per default there _is_ a word boundary
between 'y' and '_', and from here it goes downward.

It is wrong to change the search pattern to "symbol boundary" instead of
"word boundary": The ':' character is also a symbol in CPerl mode and
the regexp would then miss q:string: constructs.

The patch is a small change to eliminate the false detection of
quote constructs by yet another special case, plus some tests.
-- 
Cheers,
haj
[0001-cperl-mode-Don-t-interpret-y_-as-start-of-y-function.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47112; Package emacs. (Thu, 18 Mar 2021 07:07:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: haj <at> posteo.de (Harald Jörg)
Cc: 47112 <at> debbugs.gnu.org
Subject: Re: bug#47112: cperl-mode: Wrong highlighting of tr, y, q with _
Date: Thu, 18 Mar 2021 08:06:30 +0100
haj <at> posteo.de (Harald Jörg) writes:

> The patch is a small change to eliminate the false detection of
> quote constructs by yet another special case, plus some tests.

Thanks; 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. (Thu, 18 Mar 2021 07:07:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 47112 <at> debbugs.gnu.org and "E. Choroba" <choroba <at> matfyz.cz> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 18 Mar 2021 07:07: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. (Thu, 15 Apr 2021 11:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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