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: Wed, 13 Jun 2012 14:26:55 +0400 Message-ID: <87395z7bio.fsf@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1339583237 22601 80.91.229.3 (13 Jun 2012 10:27:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2012 10:27:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 13 12:27:17 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 1SeknC-0007g6-PS for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2012 12:27:14 +0200 Original-Received: from localhost ([::1]:40085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeknC-0003HH-Mu for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2012 06:27:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sekn5-0003GD-9g for emacs-devel@gnu.org; Wed, 13 Jun 2012 06:27:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sekn1-0001B5-Sx for emacs-devel@gnu.org; Wed, 13 Jun 2012 06:27:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:45204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sekn1-0001A1-ME for emacs-devel@gnu.org; Wed, 13 Jun 2012 06:27:03 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Sekmx-00078y-8V for emacs-devel@gnu.org; Wed, 13 Jun 2012 12:26:59 +0200 Original-Received: from 178.252.98.87 ([178.252.98.87]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Jun 2012 12:26:59 +0200 Original-Received: from dgutov by 178.252.98.87 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Jun 2012 12:26:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 178.252.98.87 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (windows-nt) Cancel-Lock: sha1:X5/N4Gk9XZ2zXOxAjowf9ZHo6o4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:150916 Archived-At: Hi François, > As it is my first experience with emacs lisp programming, I would be > really grateful to receive your feedbacks on any aspect of this mode > (core programming, function/var naming, conventions, etc.). For many > aspects, I wonder if I use hacks or correct ways to do the job (ex. I > look at the face name in my indent function to know if (point) is in a > comment or a string). To address the last point, you'd usually call (syntax-ppss) and examine the returned value. `M-x describe-function parse-partial-sexp` for its format. > I will also publish a web page which will look like this: > http://fxbois.free.fr/lisp/web-mode.html > > Perhaps you also have comments about it. I don't write PHP, so I'm definitely not going to use it, but you may be interested in this addition to mmm-mode I wrote last weekend: https://github.com/purcell/mmm-mode/blob/master/mmm-erb.el Basically, it provides syntax highlighting and smart indentation, supporting CSS, JS and ERB/EJS subregions. And utility commands already present in html-mode. It reuses submodes' indent-line-functions, so extending it to support PHP, for example, shouldn't be much harder than writing a few regexps for `mmm-add-group` and `mmm-add-classes` and a scanning function like `mmm-erb-scan-erb`. That's provided, of course, we'll have some php-mode package to work with. mmm-mode is rather heavy, so speed might become an issue with large files, but it should have room for optimization. -- Dmitry