From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: senny Newsgroups: gmane.emacs.help Subject: Re: indirect-region (make-indirect-buffer) breaks major-mode fontification Date: Wed, 18 Nov 2009 05:52:02 -0800 (PST) Organization: http://groups.google.com Message-ID: <9be07ac3-7eca-4417-8766-6cf9430ad4a2@l2g2000yqd.googlegroups.com> References: <61136d02-7d49-4b29-82e4-3d970cb55175@m38g2000yqd.googlegroups.com> <453D5202-26FA-4AE5-9AC6-1F4973C42A9B@gmail.com> <58207d59-3528-4ee7-b8a7-b3f2f1f3e14a@r24g2000yqd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1258555952 8515 80.91.229.12 (18 Nov 2009 14:52:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2009 14:52:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 18 15:52:25 2009 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.50) id 1NAltR-00040U-2j for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Nov 2009 15:52:25 +0100 Original-Received: from localhost ([127.0.0.1]:33750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAltQ-0007jG-Jr for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Nov 2009 09:52:24 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!l2g2000yqd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 127 Original-NNTP-Posting-Host: 194.41.216.154 Original-X-Trace: posting.google.com 1258552322 11508 127.0.0.1 (18 Nov 2009 13:52:02 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 18 Nov 2009 13:52:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l2g2000yqd.googlegroups.com; posting-host=194.41.216.154; posting-account=HpnstAoAAADdixpnvjy3qaoKJJO_Jdvb User-Agent: G2/1.0 X-HTTP-Via: ICAP/1.0 172.21.18.11 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:174804 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:69875 Archived-At: On 18 Nov., 14:30, Lennart Borgman wrote: > On Wed, Nov 18, 2009 at 8:54 AM, senny 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 > > >> =A0http://ourcomments.org/Emacs/DL/elisp/nxhtml/beta/ > > >> This has support for server side javascript. Just do > > >> =A0 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. > > > =A0- 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= . > > > =A0- When I call (cleanup-buffer =3D> starterkit function to indent, > > untabify and trailing whitespace removal) > > =A0 =A0It takes like 6 seconds to clean the buffer where nxml mode take= s > > 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 > > =A0 =A0M-x emacs-Q-nxthml > > > =A0- 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. > > > =A0- 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: > > =A0 =A0M-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 o= ld 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 This discussion is probably not the right place to start a discussion about nXhtml features and bugs. You should probably name me a place where we can go into detail about the bugs I have with nXhtml mode. To conclude: I am still looking for a fontification fix with the "indirect" buffer approach. All the fuzz i just had with one page and nXhtml shows me, that I am better served with a quick and dirty solution. I need things to work fast and work as expected. Of course there could be conflicts with nXhtml and my .emacs configuration (which has grown fairly large and is available here: http://github.com/senny/emacs= -configs) but I don't have the time to dig into nXhtml and figure out how everything works. Thanks for your assistance and the fast feedback.