help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (cperl-mode) Problems with syntax highlighting after __DATA__ !


From: Stefan Monnier
Subject: Re: (cperl-mode) Problems with syntax highlighting after __DATA__ !
Date: Wed, 08 Dec 2010 15:32:11 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> perl-mode also tries to highlight behind __DATA__,

Yes, of course: short of using multiple major modes (which is something
Emacs doesn't support very well for now), there's not much highlighting
we can do other than assuming Perl syntax.

I guess we could have perl-mode look at the first line after __DATA__
and if it looks like "# -*- perl -*-" highlight the rest as Perl code,
and otherwise highlight it as some sort of string/comment.

> and also slows down when scrolling sometimes showing a busy mouse
> pointer.  But it doesn't really hang for more than a second!

That sounds pretty slow.  Speed of perl-mode highlighting non-perl code
is not a very serious concern, but maybe this is a legitimate
performance bug.  You might/should be able to reproduce the bug simply
by opening a similar html file and doing M-x perl-mode.

In any case, please report it via M-x report-emacs-bug.  You'll probably
need to include a sample file, since I can't reproduce this in my tests
(except when going straight to the end of the file, but there's not
much we can do about that case, other than speed up highlighting.
And that delay is already present in normal cases: it just depends on
the size of the file).

> (which is no surprise since perl-mode does less highlighting than
> cperl-mode - perl has a very rich syntax, maybe the richest of all
> mainstream languages)

Indeed perl-mode does a bit less work here.  Tho the only relevant work
here is in making sure the highlighting is correct rather than in
performing the highlighting per-se, so having fewer distinct elements
highlighted does not explain the sped difference.  OTOH if perl-mode
gets the highlighting wrong, that could be a good explanation for the
speed difference.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]