unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: senny <yves.senn@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: indirect-region (make-indirect-buffer) breaks major-mode  fontification
Date: Wed, 18 Nov 2009 14:30:54 +0100	[thread overview]
Message-ID: <e01d8a50911180530g7e48e04akb33eb68a58066dc3@mail.gmail.com> (raw)
In-Reply-To: <58207d59-3528-4ee7-b8a7-b3f2f1f3e14a@r24g2000yqd.googlegroups.com>

On Wed, Nov 18, 2009 at 8:54 AM, senny <yves.senn@gmail.com> 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
>>
>>  http://ourcomments.org/Emacs/DL/elisp/nxhtml/beta/
>>
>> 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
faster.

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: www.postfinance.ch


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	other threads:[~2009-11-18 13:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 12:43 indirect-region (make-indirect-buffer) breaks major-mode fontification senny
2009-11-17 14:01 ` Lennart Borgman
     [not found] ` <mailman.10887.1258466524.2239.help-gnu-emacs@gnu.org>
2009-11-17 14:16   ` senny
2009-11-17 14:20     ` Joost Kremers
2009-11-17 14:40       ` senny
2009-11-17 15:13     ` Lennart Borgman
     [not found]       ` <ADEECBBC-DEC5-45E1-9A56-C8877DA04F7C@gmail.com>
     [not found]         ` <e01d8a50911171135g288b67dfk8bcc6d15812a994c@mail.gmail.com>
     [not found]           ` <453D5202-26FA-4AE5-9AC6-1F4973C42A9B@gmail.com>
2009-11-17 20:28             ` Lennart Borgman
     [not found]             ` <mailman.10926.1258489768.2239.help-gnu-emacs@gnu.org>
2009-11-18  7:54               ` senny
2009-11-18 13:30                 ` Lennart Borgman [this message]
     [not found]                 ` <mailman.10965.1258551083.2239.help-gnu-emacs@gnu.org>
2009-11-18 13:52                   ` senny
2009-11-18 15:44                     ` Lennart Borgman
2009-11-18 16:38                       ` Lennart Borgman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e01d8a50911180530g7e48e04akb33eb68a58066dc3@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=yves.senn@gmail.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).