From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: web-mode.el Date: Thu, 14 Jun 2012 13:28:39 -0400 Message-ID: References: <4FD9F40C.90406@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1339694939 10457 80.91.229.3 (14 Jun 2012 17:28:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2012 17:28:59 +0000 (UTC) Cc: cyd@gnu.org, lennart.borgman@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 14 19:28:55 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 1SfDqk-0008Oh-5u for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2012 19:28:50 +0200 Original-Received: from localhost ([::1]:57069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfDqk-0002ec-3H for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2012 13:28:50 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfDqg-0002eL-Um for emacs-devel@gnu.org; Thu, 14 Jun 2012 13:28:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfDqf-0001J6-9k for emacs-devel@gnu.org; Thu, 14 Jun 2012 13:28:46 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:62937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfDqb-0001IN-NG; Thu, 14 Jun 2012 13:28:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09MCqwm/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLDiYSFBgNJIgcBboJixuFKQOjM4FYgwWBOg X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="191413778" Original-Received: from 76-10-172-38.dsl.teksavvy.com (HELO pastel.home) ([76.10.172.38]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Jun 2012 13:28:39 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 7582B59726; Thu, 14 Jun 2012 13:28:39 -0400 (EDT) In-Reply-To: <4FD9F40C.90406@yandex.ru> (Dmitry Gutov's message of "Thu, 14 Jun 2012 18:24:12 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:150947 Archived-At: > 1) js-mode uses (widen) at the beginning of js-indent-line, and then calls > (syntax-ppss). Depending on how multi-major-mode works, widen is not necessarily a problem. Clearly, it would need to hook into syntax-ppss. > 2) sgml-indent-line calls sgml-parse-tag-backward, which does > (re-search-backward "[<>]"), finds "<" and performs simple regexp check. > Thus, <% if a < 3 %> breaks indentation on following lines, until first > closing tag. I think we can treat this as a bug in sgml-indent-line, which should try and use syntax-ppss or something like that instead of regexps. >> Of course, tweaking some parts of the C mode might help. E.g. we could >> maybe extend syntax-tables slightly so that chunk boundaries are marked >> with a special syntax-table value which then makes forward-comment skip >> over "other language" chunks, so that any indentation code which >> consistently ignores comments would then work in multi-major-mode. > Did you mean to write "C code" in the first sentence? Yes, indeed, sorry. > As far as I can see, enhanced (forward-comment) won't help much with > indentation. It would, if you combine it with parse-sexp-ignore-comments. > And crossing two boundaries won't necessarily mean that we're in a chunk > in the same mode (or we're limited to supporting only two modes in the > same buffer), so that means syntax-table values can't be trivial. > Cons cell (mode-above . mode-below), and related code will need > to consider movement direction? Something like (mode-above . mode-below) is what I had in mind, yes. Stefan