all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: (cperl-mode) Problems with syntax highlighting after __DATA__ !
Date: Sat, 16 Oct 2010 22:56:00 -0400	[thread overview]
Message-ID: <jwvmxqd35qe.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: 70e70be1-3110-4136-97a0-dd8d923591de@28g2000yqm.googlegroups.com

> 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	other threads:[~2010-10-17  2:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13 12:22 (cperl-mode) Problems with syntax highlighting after __DATA__ ! LanX
2010-10-15  6:57 ` Ilya Zakharevich
2010-10-15 10:40   ` LanX
2010-10-15 13:14     ` LanX
2010-10-15 13:35       ` LanX
2010-10-15 13:35       ` LanX
2010-10-15 22:40       ` Ilya Zakharevich
2010-10-16 14:20         ` LanX
2010-10-17  2:56           ` Stefan Monnier [this message]
2010-10-19 15:38             ` Ted Zlatanov
2010-10-20 19:40               ` Ilya Zakharevich
2010-10-20 19:42               ` Ilya Zakharevich
2010-10-21 11:43               ` LanX
2010-10-22 15:57                 ` Ted Zlatanov
2010-10-24  5:59                   ` Ilya Zakharevich
2010-10-17 11:03           ` Ilya Zakharevich
2010-10-15 14:25 ` Stefan Monnier

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=jwvmxqd35qe.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.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.