From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: How to edit "mixed" (e.g. HTML/JavaScript) files? Date: Thu, 08 Mar 2007 18:15:11 +0100 Message-ID: <45F0449F.8010308@gmail.com> References: <87hcsw2hhw.fsf@gmail.com> <87wt1sgdjs.fsf@localhorst.mine.nu> <45F00F30.60707@gmail.com> <87slcfhlks.fsf@localhorst.mine.nu> <45F0349D.5060602@gmail.com> <87k5xrhejs.fsf@localhorst.mine.nu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1173374151 31307 80.91.229.12 (8 Mar 2007 17:15:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Mar 2007 17:15:51 +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 18:15:45 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 1HPMDI-0003nh-L4 for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 18:15:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPMDW-0001P3-DJ for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 12:15:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HPMDI-0001Ox-GE for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 12:15:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HPMDG-0001Ol-BS for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 12:15:35 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPMDG-0001Oi-8J for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 12:15:34 -0500 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HPMD1-0003Ay-Mh for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 12:15:19 -0500 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:59599 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1HPMCz-0004vX-7F for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 18:15:17 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666 In-Reply-To: <87k5xrhejs.fsf@localhorst.mine.nu> X-Antivirus: avast! (VPS 000722-3, 2007-03-08), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HPMCz-0004vX-7F. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1HPMCz-0004vX-7F 55c86c95f79f1efdb6a7a0b446967baa X-detected-kernel: Linux 2.6? (barebone, rare!) 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:41807 Archived-At: David Hansen wrote: > On Thu, 08 Mar 2007 17:06:53 +0100 Lennart Borgman wrote: >> 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). Ah, I see. Then perhaps this is the reason that no one has gotten it to work for nxml-mode and its derivates (like nxhtml-mode). Those modes must look at the whole buffer to be able to check against the DTD. Maybe this can be fixed by using an extra indirect buffer for the DTD checking ... > Have a look at the multi-mode sources. It's a relatively small, > clean coded and good commented package (no not by me ;). I will. > 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). Yes, see above. >> 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. I can see your point. But I meant that if a mode where restricted to just a part of a buffer it would not be that bad. But there are no structures within Emacs to support that - or multi-mode might be a way to do it.