GNU bug report logs - #69604
perl mode: quotes give wrong colors

Previous Next

Package: emacs;

Reported by: Dan Jacobson <jidanni <at> jidanni.org>

Date: Thu, 7 Mar 2024 08:54:02 UTC

Severity: normal

Done: Harald Jörg <haj <at> posteo.de>

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 69604 in the body.
You can then email your comments to 69604 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#69604; Package emacs. (Thu, 07 Mar 2024 08:54:02 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. (Thu, 07 Mar 2024 08:54: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 <at> gnu.org
Subject: perl mode: quotes give wrong colors
Date: Thu, 07 Mar 2024 16:53:08 +0800
$ cat r.pl
print "0$\"$_$/";
print "$_$\"0$/";
$ perl -c r.pl
r.pl syntax OK
$ emacs -Q r.pl
emacs-version "29.2"




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69604; Package emacs. (Fri, 08 Mar 2024 07:27:02 GMT) Full text and rfc822 format available.

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

From: Harald Jörg <haj <at> posteo.de>
To: 69604 <at> debbugs.gnu.org
Subject: perl-mode and cperl-mode: $\" in a double-quoted string
Date: Fri, 08 Mar 2024 07:25:45 +0000
Good catch!  The same symptoms can be seen in cperl-mode.

Both perl-mode and cperl-mode treat "$" as quoting character in their
syntax tables.  This is needed for Perl's punctuation variables like $(
and $" which would otherwise be interpreted as unbalanced parens or
quotes.

In a string, this safety belt is not required, and it actually misfires
in the case of "$\"", which is part of the demo code.

This is now treated correctly in the Emacs master branch for both
perl-mode and cperl-mode.




bug closed, send any further explanations to 69604 <at> debbugs.gnu.org and Dan Jacobson <jidanni <at> jidanni.org> Request was from Harald Jörg <haj <at> posteo.de> to control <at> debbugs.gnu.org. (Fri, 08 Mar 2024 07:33:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69604; Package emacs. (Fri, 08 Mar 2024 08:34:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Harald Jörg <haj <at> posteo.de>
Cc: 69604 <at> debbugs.gnu.org
Subject: Re: bug#69604: perl-mode and cperl-mode: $\" in a double-quoted string
Date: Fri, 08 Mar 2024 10:32:21 +0200
> From: Harald Jörg <haj <at> posteo.de>
> Date: Fri, 08 Mar 2024 07:25:45 +0000
> 
> Good catch!  The same symptoms can be seen in cperl-mode.
> 
> Both perl-mode and cperl-mode treat "$" as quoting character in their
> syntax tables.  This is needed for Perl's punctuation variables like $(
> and $" which would otherwise be interpreted as unbalanced parens or
> quotes.
> 
> In a string, this safety belt is not required, and it actually misfires
> in the case of "$\"", which is part of the demo code.
> 
> This is now treated correctly in the Emacs master branch for both
> perl-mode and cperl-mode.

Thanks.  Should this bug be closed now?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69604; Package emacs. (Fri, 08 Mar 2024 10:11:01 GMT) Full text and rfc822 format available.

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

From: Harald Jörg <haj <at> posteo.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69604 <at> debbugs.gnu.org
Subject: Re: bug#69604: perl-mode and cperl-mode: $\" in a double-quoted string
Date: Fri, 08 Mar 2024 10:09:21 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Harald Jörg <haj <at> posteo.de>
>> Date: Fri, 08 Mar 2024 07:25:45 +0000
>> 
>> Good catch!  The same symptoms can be seen in cperl-mode.
>> 
>> Both perl-mode and cperl-mode treat "$" as quoting character in their
>> syntax tables.  This is needed for Perl's punctuation variables like $(
>> and $" which would otherwise be interpreted as unbalanced parens or
>> quotes.
>> 
>> In a string, this safety belt is not required, and it actually misfires
>> in the case of "$\"", which is part of the demo code.
>> 
>> This is now treated correctly in the Emacs master branch for both
>> perl-mode and cperl-mode.
>
> Thanks.  Should this bug be closed now?

Yes!  I have closed it now.
-- 
Cheers,
haj




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

This bug report was last modified 1 year and 78 days ago.

Previous Next


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