From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: web-mode.el Date: Tue, 19 Jun 2012 05:18:20 +0400 Message-ID: <4FDFD35C.5070701@yandex.ru> References: <4FD9F40C.90406@yandex.ru> <4FDAAADA.1030609@yandex.ru> <4FDC87D9.3080704@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1340068710 12206 80.91.229.3 (19 Jun 2012 01:18:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2012 01:18:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 19 03:18:29 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 1Sgn5P-0008Ag-Vz for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2012 03:18:28 +0200 Original-Received: from localhost ([::1]:49042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sgn5P-0007hY-V5 for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2012 21:18:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sgn5M-0007hI-FM for emacs-devel@gnu.org; Mon, 18 Jun 2012 21:18:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sgn5K-00060a-LI for emacs-devel@gnu.org; Mon, 18 Jun 2012 21:18:24 -0400 Original-Received: from forward8.mail.yandex.net ([77.88.61.38]:51564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sgn5K-00060I-46 for emacs-devel@gnu.org; Mon, 18 Jun 2012 21:18:22 -0400 Original-Received: from smtp6.mail.yandex.net (smtp6.mail.yandex.net [77.88.61.56]) by forward8.mail.yandex.net (Yandex) with ESMTP id 076A1F61233; Tue, 19 Jun 2012 05:18:19 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1340068700; bh=5+TjzX4ucaaaqP4+vHXcDFeIKYykzWmYkmZMCwvKnSg=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=cQEtz57XXc+GbvutqUBug4GvXZK8sTCee3K5sTZZIT/6OoB+KJeWl8NYWX8/1mpC/ 9RGrXwqi0WHnxOHiBz1Ap9I4iBb8WWCAosiJFD4wk+Fv/dbZsEVPHxE3zIO7wdX8XS 4s0Kw1+5g3FUo/zNtR+HuycdHmnC0r4L8KlmDMBI= Original-Received: from smtp6.mail.yandex.net (localhost [127.0.0.1]) by smtp6.mail.yandex.net (Yandex) with ESMTP id D9D2B1640486; Tue, 19 Jun 2012 05:18:19 +0400 (MSK) Original-Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp6.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IJ6mGKZr-IJ6CGvqC; Tue, 19 Jun 2012 05:18:19 +0400 X-Yandex-Rcpt-Suid: lennart.borgman@gmail.com X-Yandex-Rcpt-Suid: emacs-devel@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1340068699; bh=5+TjzX4ucaaaqP4+vHXcDFeIKYykzWmYkmZMCwvKnSg=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=uLwf1OfKGAfWmmPhbMN5hy4gpiCTnpcycTuMQoByInqsbscj86m4z9cprBt/tqo2n jmkx2ku0ukRt07thNiRghOBqu4IhOoDxkoXeQzSyZo0pGbrRsjhPZUzlv6xkCWi7DL 2JgGhquqfe81iFVij+HZeRYLy2rvOrFRIM7+T7HU= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 77.88.61.38 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:151007 Archived-At: On 16.06.2012 17:30, Lennart Borgman wrote: >>>> As an aside, this bit from the docstring sounds not very useful, maybe >>>> even 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? >> >> >> If mumamo-depth doesn't take into account nesting level of plain html tags, >> then this is going to be wrong when nesting levels are different. >> >> If it does take into account those, this shouldn't be a problem, but I still >> don't understand why you need this mechanic at all. > > The reason you may need it is that for example chunks at a deeper > level may have html code in them. They may be writing html code. > MuMaMo tries to make it possible to fontify and indent this html code > separately then. What if the difference between mumamo-depth of pre-pre chunk and this one is 1 or -1, can you indent correctly in this case? If so, why the difference of 0 is a special case? Is this just a speed optimization? >> js2-mode is doing things differently from most major modes: 1) it reads all >> buffer contents, scanning through every buffer character one by one while >> parsing, 2) its fontification is all manual, performed by setting >> 'font-lock-face and 'syntax-table text properties during parsing. >> And parsing is scheduled directly from after-change-functions, not through >> jit-lock. > > That is because it is a full parser. I think we will see more such > examples now that CEDET is finally inside Emacs. As long as we don't try to use js2-mode as primary mode, the "full parser" thing won't be a problem, since it respects narrowing. The only thing to change is the way parsing is invoked. >>>> 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. >> >> >> I was asking specifically about nxml, because my initial attempt to make it >> work with erb-style tags in mmm-mode had failed. > > Yes, I was trying to answer that. The reason it fails is because > nxml-mode (like js2-mode) contains a full parser. I have been thinking > that rewriting it is very difficult, but maybe Stefan's proposal (the > change to "syntax-ppss") is a rather easy road. I don't think this changes much for nxml-mode: it uses the parser from xmltok.el, which doesn't employ any of the -sexp commands.