From: Stefan Kangas <stefan@marxist.se>
To: jidanni@jidanni.org
Cc: 997@debbugs.gnu.org
Subject: bug#997: perl mode blows "'" etc.
Date: Sat, 29 Feb 2020 03:58:35 +0100 [thread overview]
Message-ID: <87a75285gk.fsf@stefankangas.se> (raw)
In-Reply-To: <871vzhoasd.fsf@jidanni.org> (jidanni's message of "Thu, 18 Sep 2008 21:15:14 +0800")
title 997 Incorrect perl-mode syntax highlighting in some cases (e.g. using "'")
tags 997 confirmed
found 997 28.0.50
thanks
jidanni@jidanni.org writes:
> Perl mode screws up bad with this file. Cperl mode gets it better.
> $ perl -c p.pl
> p.pl syntax OK
> $ cat p.pl
> /this is a perl program to demonstrate emacs's wacky color biz/;
> /this line is in the wrong color until here'/; #///
I can reproduce this on current master (28.0.50).
Open a file like this using perl-mode under emacs -Q to see the
incorrect highlighting:
/correct 'incorrect/;
/incorrect' correct/;
The problem goes away if the file looks like this instead:
$foo =~ /foobar/;
/correct 'incorrect/;
/incorrect 'correct/;
> /\b.*\bpic(ture)?s\b/;
> /this line is in the wrong color/;
> #this comment turns back on emacs correct color: \b\b
> /this line is in the right color/;
> /but not this line until the end\/;/m;
I see some incorrect highlighting in this example too. Adding the
"$foo =~ /foobar/;" line from above seems to fix it here too.
> $ emacs -Q p.pl
> Anyway, one usually ends up having to stick in special comments with
> some / ; ` ' etc. in them lest large tracts of code become the wrong
> color. emacs-version "22.2.1"
I tried inserting the problematic lines into a larger Perl file, but I
couldn't reproduce the issue. I'm not sure if that means that the
incorrect coloring only happens when these lines are inserted at the
very beginning of a file.
Best regards,
Stefan Kangas
next prev parent reply other threads:[~2020-02-29 2:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-18 13:15 bug#997: perl mode blows "'" etc jidanni
2020-02-29 2:58 ` Stefan Kangas [this message]
2020-02-29 3:12 ` 積丹尼 Dan Jacobson
2020-11-17 17:52 ` bug#997: perl-mode: Merging was not quite correct Harald Jörg
2020-11-19 16:07 ` Noam Postavsky
2020-11-19 17:07 ` bug#997: perl-mode: Un-merging an unrelated bug Harald Jörg
2022-09-19 16:03 ` bug#997: perl-mode: Incorrect syntax highlighting for regex at top-level Mauro Aranda
2022-09-19 18:37 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a75285gk.fsf@stefankangas.se \
--to=stefan@marxist.se \
--cc=997@debbugs.gnu.org \
--cc=jidanni@jidanni.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.