[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs very slow opening file
From: |
Stefan Monnier |
Subject: |
Re: Emacs very slow opening file |
Date: |
Wed, 28 Sep 2005 09:31:30 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
>> You can still see the same problem with the above if right after opening
>> the file you do M->
> Yes, I can. In fact if I leave y-or-n-p defined as it should be, I see the
> long pause twice - once when I visit the file and once again when I do
> "M->". Is Emacs font-lockifying the buffer twice?
Looks that way. This may be due to the new code that turns font-lock
OFF-then-ON in case the font-lock-keywords were changed in the mean time.
> So it's a conjunction of mostly 2 problems:
>> - accidental use of C mode.
>> - slowness of C font-lock-keywords on non-C text.
>> I'm not sure how to best avoid/fix the problem.
> Would it help to treat ".patch" files specially?
With a file name "bigfile" this wouldn't help, but if your file has a .patch
extension, yes of course that would help.
> I notice inhibit-first-line-modes-regexps is treating .tar and .tgz files
> specially, but possibly only for leading -*- lines. We know that .patch
> files are potentially going to contain file local variables which we
> shouldn't honour.
That sounds like a good approach. But it seems that the variable indeed
only has an effect on the -*- on the first line, not for the "Local
Variables" section at the end.
Stefan