[Top][All Lists]

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

Re: web-mode.el

From: Bois Francois-Xavier
Subject: Re: web-mode.el
Date: Wed, 13 Jun 2012 10:39:16 +0200

On Wed, Jun 13, 2012 at 9:45 AM, Chong Yidong <address@hidden> wrote:
> Bois Francois-Xavier <address@hidden> writes:
>> I've written web-mode.el, a major mode for PHP/HTML templates files.
>> It aims to natively indent and syntaxcolor according to the "context"
>> of (point) (which can be in an HTML part or in a PHP/JavaScript/CSS
>> bloc).
> Thanks, this looks interesting.  The problem with nXhtml mode (and
> php-mode) is that we've had a hell of a time trying to get the copyright
> assignments to get them incorporated into Emacs, and at this point I've
> given up.  So if you have a newly-written mode that provides similar
> functionality, and are willing to make a copyright assignment to the
> FSF, I might be interested in including it in Emacs.

I would be very happy to have the mode included. What would be the
steps to have it in ?

> I took a brief glance through your code.  Here are a few comments:
> The name should be something like php-template-mode.el rather than
> web-mode.el.

The mode will perhaps take care of other languages. Adding Ruby/Java
(JSP) to the mode would be quite easy now. So I would prefer to have a
generic name.

>  (defvar web-mode-variable-name-face 'web-mode-variable-name-face
>    "Face name to use for variable names.")
> Don't do this.  Just define the variable with defface, and use the face
> name (a symbol) directly wherever you need the face.  (This is mentioned
> in the Elisp manual node "Faces".)

I will look into this

> The major mode should derive from either prog-mode or text-mode (not
> sure which is better), rather than fundamental mode.

Ok. But I have a question. Is it a convention ? Is it necessary ?
I used to think that deriving form a very simple mode would make my mode faster.

>  (defun web-mode-reload ()
>    "Reload web-mode."
>    (interactive)
>    (unload-feature 'web-mode)
>    (web-mode))

It was for me while I was developing.

> I'm not sure what this is for, but it's probably not necessary.

reply via email to

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