From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: web-mode.el Date: Thu, 14 Jun 2012 03:49:49 +0200 Message-ID: References: <4FD9313D.70303@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1339638644 9358 80.91.229.3 (14 Jun 2012 01:50:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2012 01:50:44 +0000 (UTC) Cc: cyd@gnu.org, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 14 03:50:41 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SezCm-0006sO-Ic for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2012 03:50:36 +0200 Original-Received: from localhost ([::1]:58554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SezCm-0002HT-Il for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2012 21:50:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SezCj-0002HO-BZ for emacs-devel@gnu.org; Wed, 13 Jun 2012 21:50:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SezCe-0003bm-ED for emacs-devel@gnu.org; Wed, 13 Jun 2012 21:50:32 -0400 Original-Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:61225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SezCZ-0003YM-R9; Wed, 13 Jun 2012 21:50:24 -0400 Original-Received: by lahi5 with SMTP id i5so1049877lah.0 for ; Wed, 13 Jun 2012 18:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ptvy8fzSRW6MYXHjKIMgKfFZSvBCf2607oaR+oOpLuY=; b=A9vVXLVqN/V+hlCm+Ih4BDnhSvcOreS5gtW8pf4C9FitUWXBz8G9m6EIqZR5qJ6pOq p3mQ0wd1GKT8Q6BYzp8rs62zEjyj2Ayp2rm7N88Qs4PWA/KT13INYmr/NPPPzvSaRzbg 8p9uf1KOUSCyJbQqadu1LPqZtNFAW1YddAD/OBCZgTPSKtyp+Qg2LVowQWEYM7DbmPTn +YWflH20ySFxtA0GgVeBe7Tu74k07/NXVNGTYtAoQolH6T8iVIQLNRDKJga7Id+tYjMz FADL2TOq6rzxm6sm/4vU7F2aPX2MTE37reJMU+Y+oRMwgjYu3YmcFba8LOdWuAeD6HyO zq2w== Original-Received: by 10.152.106.12 with SMTP id gq12mr45328lab.17.1339638620338; Wed, 13 Jun 2012 18:50:20 -0700 (PDT) Original-Received: by 10.112.41.99 with HTTP; Wed, 13 Jun 2012 18:49:49 -0700 (PDT) In-Reply-To: <4FD9313D.70303@yandex.ru> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150939 Archived-At: On Thu, Jun 14, 2012 at 2:33 AM, Dmitry Gutov wrote: > > Lennart Borgman writes: > > > > However it might not be worth the trouble. The real problem lies in > > the Emacs C core. Parsing functions can currently not be stopped from > > parsing things outside of the major mode chunk they belong too. > > (mumamo.el goes a long way to try to address this problems as far as > > possible. That makes the code quite complicated. A rewrite of the C > > core makes things very simple. In addition to this rewrite of the > > scheduling functions to add suitable tools for handling chunk finding > > might be necessary, but that is much simpler.)=C2=A7 > > From what I know, mmm-mode counteracts this problem effectively enough, > narrowing buffer to chunks during fontification, binding > font-lock-dont-widen to t, etc. I am afraid that is a total misunderstanding. Narrowing etc does not help because it does not affect all the functions involved. > Anyway, you've seen the list of my immediate gripes about how MuMaMo > works for ERB, and I'm inclined to fault chunk detection Chunk detection must logically be done from the start of the file. In the first version of MuMaMo I tried to do chunk detection from anywhere in the file. That worked for simple cases but not for more complicated cases so I rewrote this several years ago. I have no idea about what trouble you have had. Perhaps you could describe them? (Maybe there are still pieces of code I have forgotten to rewrite?) > and indentation logic in your code Indentation is surpricingly hard actually. One problem is that you have to do some language specific parsing (which the major mode normally does). Another problem is getting this to work with chunks and across chunks. There are several alternatives for this in mumamo.el - and unfortunately I think there might some trouble there. I suspect you have been looking at some of the easier cases. Please take a look at the test cases. There should be more, but I think I have written test cases for some of the troublesome cases. > rather than facilities provided by Emacs. See my first comment above.