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: Tue, 17 Nov 2009 23:54:45 -0800 (PST) Organization: http://groups.google.com Message-ID: <58207d59-3528-4ee7-b8a7-b3f2f1f3e14a@r24g2000yqd.googlegroups.com> References: <61136d02-7d49-4b29-82e4-3d970cb55175@m38g2000yqd.googlegroups.com> <453D5202-26FA-4AE5-9AC6-1F4973C42A9B@gmail.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 1258533658 503 80.91.229.12 (18 Nov 2009 08:40:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2009 08:40:58 +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 09:40:48 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 1NAg5m-0007Dx-VV for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Nov 2009 09:40:48 +0100 Original-Received: from localhost ([127.0.0.1]:39284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAg5m-0006n5-6e for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Nov 2009 03:40:46 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!newsfeed.news2me.com!newsfeed2.telusplanet.net!newsfeed.telus.net!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!r24g2000yqd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 195 Original-NNTP-Posting-Host: 194.41.216.154 Original-X-Trace: posting.google.com 1258530886 5826 127.0.0.1 (18 Nov 2009 07:54:46 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 18 Nov 2009 07:54:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r24g2000yqd.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.4 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:174794 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:69868 Archived-At: On 17 Nov., 21:28, Lennart Borgman wrote: > On Tue, Nov 17, 2009 at 8:53 PM, Yves Senn wrote: > > > Of course there are a lot of features I don't use embedded into emacs. > > But I try not to drop loads of third party code into my configurations = when I just need > > a little piece. Its like installing eclipse to edit xml files but I gue= ss thats just my opinion. > > No, some people think this way. Others think it is good to get the whole = nXhtml. > > I have just decided I do not have time to distribute it in pieces. A > lot of people would get their setup wrong. Using multi major modes is > a bit more complicated if you do it yourself. > > > The buffer approach is very simple. It lets me write a function that > > lets me edit a part from one buffer in another one with another major-m= ode. > > > That would completely accomplish the goal to edit parts with another mo= de > > and would also allow me to use the features provided by the given mode. > > >> Maybe you just want to use narrowing in Emacs to edit a part of a buff= er? > > > I use narrowing a lot but it does not allow me to change the current ma= jor-mode. > > Another thing, that "indirect" buffers allow me is to edit those parts = all at once in different windows. > > > I know it is not the best solution but for the few occurrences when I a= m doing html prototyping or SSJS > > it would be enough for sure. > > Yes, it can work in many cases. Sometimes the rest of the buffer > interferes so you do not get the syntax hilighting you expect. The > same for indentation. > > > Integrated is probably the wrong term. I mean that I am heading for a s= imple solution > > using the on board mechanisms from emacs (indirect buffers) in this cas= e. > > It is perhaps good to try. A lot of people have done so, but after a > while they discover that it does not work as they expected. (That was > how I started too.) > > >>> I hope I could make it more clear to you what I tried to mention in m= y > >>> response. > > >> Thanks for trying. > > > 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. > > > Regards, > > Senny > > >>> Regards, > >>> Senny > > >>> Am 17.11.2009 um 16:13 schrieb Lennart Borgman: > > >>> On Tue, Nov 17, 2009 at 3:16 PM, senny wrote: > > >>> On 17 Nov., 15:01, Lennart Borgman wrote: > > >>> On Tue, Nov 17, 2009 at 1:43 PM, senny wrote: > > >>> Hey there > > >>> I am looking for a way to edit java-script and css snippets in a HTML > > >>> document with their corresponding major modes. I've tried some of the > > >>> multi major mode solutions but found most of them buggy and performin= g > > >>> slowly. Recently I found the indirect-buffer feature of emacs. This i= s > > >>> exactly what I am looking for but it somehow breaks fontification. > > >>> When I clone a region into an indirect buffer the code does not get > > >>> highlighted correctly. > > >>> This seems only to happen when the original buffer is visible in an > > >>> other window. when I only edit the indirect buffer, then fontificatio= n > > >>> works as expected. > > >>> Is there a workaround for this problem? > > >>> Perhaps try latest version of nXhtml? Which version have you tried an= d > > >>> what problems did you find. Did you report any bugs in nXhtml? > > >>> I tried nXhtml when I used emacsW32, which was about two or three > > >>> months ago (cant remember the exact version number of nXhtml). The > > >>> mode felt kinda clumsy for me. > > >>> Thanks senny. Can you tell more exactly what you think is clumsy? > >>> (nXhtml contains a lot of multi major modes and other things related > >>> to web programming.) > > >>> I did not report any errors because I > > >>> didn't looked into the details, why things are not working. > > >>> But can you please tell what it was that did not work for you? > > >>> My > > >>> impression of nXhtml was, that it was slowing my cursor movement down > > >>> a lot > > >>> I have made some optimisations since then (or rather removed some > >>> mistakes). If it feels slow you can also byte compile the whole > >>> nXhtml. (There is a menu entry in the nXhtml menu for that to make it > >>> easier.) > > >>> But of course any multi major mode solution that is dynamic and check= s > >>> for chunk boundaries while you are editing is doing a little bit more= . > >>> However I do not think you will notice it very much normally. If you > >>> have an example where it feels slow I would be glad to know. (Please > >>> try the latest version then.) > > >>> and that it had some unexpected behaviours from time to time. > > >>> You mean bugs, or? Unfortunately I have no idea what you mean unless > >>> you tell me more. > > >>> The other thing is, that I am looking for a flexible solution, I am > > >>> editing a lot of different template languages (jsp, esp, rhtml) and > > >>> it would be cool to use the same solution for all these cases. > > >>> Hm. What do you mean? This exactly what nXhtml gives you, isn't it? D= o > >>> you mean that you are not looking for a flexible solution? > > >>> If you are missing some special template language then please tell me= . > > >>> Thats > > >>> why i was heading for the "indirect-buffer" approach. > > >>> Regards, > > >>> Senny Hey Lennart 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. - When I scroll through pages (using scroll-down and scroll-up) the performance is poor - When I call (cleanup-buffer =3D> 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. - There were still some indentation bugs - The mode tried to validate the page all the time, which takes about a second and blocks emacs I tried everything with the following page: www.postfinance.ch Regards, Senny