From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Hansen Newsgroups: gmane.emacs.help Subject: Re: How to edit "mixed" (e.g. HTML/JavaScript) files? Date: Thu, 08 Mar 2007 17:43:03 +0100 Organization: disorganized Message-ID: <87k5xrhejs.fsf@localhorst.mine.nu> References: <87hcsw2hhw.fsf@gmail.com> <87wt1sgdjs.fsf@localhorst.mine.nu> <45F00F30.60707@gmail.com> <87slcfhlks.fsf@localhorst.mine.nu> <45F0349D.5060602@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173372833 26033 80.91.229.12 (8 Mar 2007 16:53:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Mar 2007 16:53:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 08 17:53:46 2007 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 1HPLs9-0002yt-Js for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 17:53:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPLsM-0006Um-W4 for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 11:53:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HPLsA-0006UW-0M for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 11:53:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HPLs8-0006Sy-B4 for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 11:53:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPLs8-0006Sl-7g for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 11:53:44 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HPLrt-0008DG-Qu for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 11:53:30 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HPLrk-0005gD-SF for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 17:53:20 +0100 Original-Received: from e178028146.adsl.alicedsl.de ([85.178.28.146]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 17:53:20 +0100 Original-Received: from david.hansen by e178028146.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 17:53:20 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 57 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: e178028146.adsl.alicedsl.de Mail-Copies-To: nobody User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) Cancel-Lock: sha1:2L07v5YrJu/Yu0ZpoYwNhoObjLM= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:41805 Archived-At: On Thu, 08 Mar 2007 17:06:53 +0100 Lennart Borgman wrote: > I guess you mean that it is bad to switch major mode because of that > it takes long time, or are there other reasons? > > If it is the time to change that is important, what do you believe > is that takes too much time? I guess mainly the first font-lock run. > When it comes to fontification the approach with indirect buffers > can not work, unfortunately, since text properties (which are used > for fontification) are shared between the buffers. multi-mode works (or at least tries to works) the way that fontification happens region by region only in the relevant buffer. In theory this should work (long time ago that i had a look at the sources). > This together with that a major mode wants to fontify the whole > buffer There's `font-lock-dont-widen' (I think one of the glitches of multi-mode is that it doesn't set this and syntactic fontification in one mode may screws it in the other mode). > makes it impossible as far as I can see. (There is nothing > in Emacs 22 beta that can remedy this either.) Have a look at the multi-mode sources. It's a relatively small, clean coded and good commented package (no not by me ;). For my taste this is a minor problem anyway as long as the text around the part of code I'm currently editing looks OK (and if not there's M-o M-o). What terrible sucks is indentation if some construct spreads over more than one region. But at least it works reliable within one region. MMM mode can't even that. I assume NXML mode won't be that happy too if you narrow it to one region (or does it widen for it's syntax analysis? Would probably be even worse). >> I hope this topic will get some more attention after the upcoming >> (?) release of Emacs 22. > > Yes, that would be good. But I think we need some experiences then > about what can work. > As far as I can see switching major mode might not be that bad if it > could be applied to a part of a buffer. This always implies unnecessary refontification which IMHO is *very* bad. David