From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: (cperl-mode) Problems with syntax highlighting after __DATA__ ! Date: Sat, 16 Oct 2010 22:56:00 -0400 Organization: A noiseless patient Spider Message-ID: References: <6dc535d1-ce05-449d-a3ff-d062f5e634d1@z28g2000vba.googlegroups.com> <55f6a9f1-fd98-4069-9bf8-8e3e550f36af@30g2000yqm.googlegroups.com> <5e32a127-1e53-4f9d-899f-6c1329a5b589@i5g2000yqe.googlegroups.com> <70e70be1-3110-4136-97a0-dd8d923591de@28g2000yqm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291871580 17564 80.91.229.12 (9 Dec 2010 05:13:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 05:13:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 06:12:56 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQYoH-0001c4-JS for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 06:12:53 +0100 Original-Received: from localhost ([127.0.0.1]:35151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQYoG-0000my-LP for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 00:12:52 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Injection-Info: mx03.eternal-september.org; posting-host="Ml8bg9Px1Z9ybLwV1rYffA"; logging-data="19838"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qRe4MOQORIun/pTBkzkPB" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:krOo+Vy/VE8B6czRBTgnkbJ2gqM= sha1:SOyVXxJAiLf0/2tW3B0GSol99rU= Original-Xref: usenet.stanford.edu gnu.emacs.help:181823 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76718 Archived-At: > 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