[Top][All Lists]

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

Re: indirect-region (make-indirect-buffer) breaks major-mode fontificat

From: Lennart Borgman
Subject: Re: indirect-region (make-indirect-buffer) breaks major-mode fontification
Date: Wed, 18 Nov 2009 14:30:54 +0100

On Wed, Nov 18, 2009 at 8:54 AM, senny <address@hidden> wrote:
>> > After that discussion I think I will give nXhtml an other shot. When I got 
>> > some spare
>> > time I will look more into nXhtml and will send you my thoughts.
>> Ok, there is a new beta now at
>> This has support for server side javascript. Just do
>>   M-x ssjs-html-mumamo-mode
>> to turn it on.

> Hey Lennart

Hi Senny,

> I just played around with the nxhtml beta you uploaded. The
> highlighting seems to work good and the cursor movement relay has been
> increased. After just a few minutes using the mode I've got some
> complaints tough.

Thanks for testing.

>  - When I scroll through pages (using scroll-down and scroll-up) the
> performance is poor

It is a bit slower the first time you scroll, since syntax coloring
has to be handled a bit differently. Normally Emacs tries to guess
what to do. It does not check everything from the beginning of the
file before coloring the syntax. It looks a little bit backwards and
tries to guess how to color the syntax.

That is good for many reasons, for example scrolling will be faster.

However when there are multiple major modes in different parts of the
buffer a bit more have to be done. It has to know what major mode (ie
programming language) there is in the part it is going to put syntax
color on.

You may think that the same stategy as above can be used and all that
is needed is to look back a little bit. This was how it worked before
in nXhtml.

It is faster, but unfortunately it often does not work. There were a
lot of complaints about this. So now nXhtml (or rather MuMaMo, part of
nXhtml) looks from the beginning just to decide what major mode to
use. Actually it have to be rather carefully when searching for the
this. MuMaMo caches this information. The first time you scroll
through a piece of the file it may be slow, but after that it will be

Maybe I should explain this somewhere, but it is a bit hard to know where.

>  - When I call (cleanup-buffer => starterkit function to indent,
> untabify and trailing whitespace removal)
>    It takes like 6 seconds to clean the buffer where nxml mode takes
> around half a second.

Is this for the example you sent me? That sounds a bit strange. Can
you please send me a copy of cleanup-buffer so I can see what it does?

Can you perhaps also try this in a fresh Emacs with just nXhtm loaded
+ just the function cleanup-buffer. To start a fresh Emacs with just
nXhtml you can do

   M-x emacs-Q-nxthml

>  - There were still some indentation bugs

Yes, that is likeley, those are a bit hard. If you tell me more about
what you have seen it might be possible to fix them.

>  - The mode tried to validate the page all the time, which takes
> about a second and blocks emacs

Validation should of course not block Emacs, but if that happens it is
probably due to some interaction with the multi major mode.
Unfortunately the integration of parsers (like the one from nxml-mode)
can not be done very well without rewriting the parsers at the moment.
(I have some ideas for how to do this, but some very deep changes in
Emacs are necessary for them.)

It might be better for you to use it without the parse (but then XHTML
completion disappears too). You can do that by selecting a multi major
mode which have "html" in its name instead of "nxhtml", for example:

   M-x html-mumamo-mode

> I tried everything with the following page:

Thanks. I have tried that too and I works quite good for me (despite my old pc).

I am using latest CVS Emacs (not yet released). What version of Emacs
are you using?

Is there perhaps something special in your .emacs (or some other startup file)?

> Regards,
> Senny

reply via email to

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