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: Sat, 16 Jun 2012 03:43:55 +0200 Message-ID: References: <4FD9F40C.90406@yandex.ru> <4FDAAADA.1030609@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1339811081 4617 80.91.229.3 (16 Jun 2012 01:44:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 16 Jun 2012 01:44:41 +0000 (UTC) Cc: cyd@gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 16 03:44:40 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 1Sfi45-0004i0-Bu for ged-emacs-devel@m.gmane.org; Sat, 16 Jun 2012 03:44:37 +0200 Original-Received: from localhost ([::1]:38363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfi45-0001gR-4c for ged-emacs-devel@m.gmane.org; Fri, 15 Jun 2012 21:44:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfi42-0001gB-CJ for emacs-devel@gnu.org; Fri, 15 Jun 2012 21:44:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sfi40-0004W0-Kl for emacs-devel@gnu.org; Fri, 15 Jun 2012 21:44:33 -0400 Original-Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:48449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfi3x-0004Vh-AW; Fri, 15 Jun 2012 21:44:29 -0400 Original-Received: by lahi5 with SMTP id i5so2942343lah.0 for ; Fri, 15 Jun 2012 18:44:26 -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:content-transfer-encoding; bh=zT26K0KOi8dplMe1GMWb7y+LHwQkIiRx7O/cYyS3huc=; b=g1mF/tYjfPVEfJw6A2A2kuH/ghJ4y0Sr78Cs6em5z8kMx0jOkMSpwV22rL40b1OKyn DusYC1xy8FUZJH1u6ErgNXRaQkbYXThx9kPtpUjgdEeiptbHhSjzGw3IuYfAOHFpdAn3 SpwIgFVD3ZOmGZzBlo+gcZQuit8mM3sCG76MFJ8bJDkj8SEHCO5yhgnHx0sTkg2WDcO/ /ZUpQp1SazfQ3RZqyTrPCiMCC51lnL9Axk2tWZnvoZ0k2x40Qd9I1fh/1rgv7jTToucr UUBEQmqCpYzH52ZUumCv1B0Gn7SJ0adie2+lIAU3ZSWRL5xaJO6YcuhzSgoMBBwKr3Y7 12rw== Original-Received: by 10.112.45.168 with SMTP id o8mr3307647lbm.88.1339811066005; Fri, 15 Jun 2012 18:44:26 -0700 (PDT) Original-Received: by 10.112.41.99 with HTTP; Fri, 15 Jun 2012 18:43:55 -0700 (PDT) In-Reply-To: <4FDAAADA.1030609@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:150963 Archived-At: On Fri, Jun 15, 2012 at 5:24 AM, Dmitry Gutov wrote: > > Fully isolating the chunks might not be the best course of action, even i= f > it were not too hard to do. > For example, if we want to adjust indentation inside <% if %> <% end%> > blocks, we need to be able to actually look inside them while we're in th= e > primary mode chunk (between those two). Can you give an example of what you mean here? > I don't think I understand the code enough to answer that, but I'm inclin= ed > to fault implementation (not necessarily of the stage you described above= ). > For example, one of the problems shows that indentation function behaves > differently, depending on where inside the (same) line the point is. Eh, yes, that is of course just a bug (but maybe not a very simple one). > As an aside, this bit from the docstring sounds not very useful, maybe ev= en > harmful: > > "- However first non-empty line indentation in a chunk when going > in is special if prev-prev chunk is on same mumamo-depth and > have the same major mode. Then indent relative last non-empty > line in prev-prev chunk." Why do you think this is wrong? > js2-mode's indentation function is very similar to js-mode, since they're > both derived from an javascript-mode. It doesn't work in multi-mode conte= xt, > though, and while fixing that shouldn't be too hard, I'm not sure it's wo= rth > spending time on, because js2-mode's advantages over js-mode are most > evident with larger files, not small snippets. Is not this is a general problem, not something specific to js2-mode? > I have yet to look into using nxml as primary mode. Do you have any > suggestions how that could be made easier? There are such multi major modes in nXhtml. However they does not always behave as I expected. >>>> Of course, tweaking some parts of the C mode might help. =C2=A0E.g. we= could >>>> maybe extend syntax-tables slightly so that chunk boundaries are marke= d >>>> with a special syntax-table value which then makes forward-comment ski= p >>>> over "other language" chunks, so that any indentation code which >>>> consistently ignores comments would then work in multi-major-mode. >> >> >> I have tried to implement something like that in mumamo.el, but I >> think it is not working correctly anymore. Something might have >> changed since I did that. > > > Could you show where this is implemented? It just stores the value of syntax-ppss cache at the end of a chunk. When handling the next chunk of the same time this value is picked up again.