[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: web-mode.el

From: Dmitry Gutov
Subject: Re: web-mode.el
Date: Wed, 13 Jun 2012 14:26:55 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (windows-nt)

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:


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]