[Top][All Lists]

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

Re: web-mode.el

From: Chong Yidong
Subject: Re: web-mode.el
Date: Wed, 13 Jun 2012 15:45:27 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

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 took a brief glance through your code.  Here are a few comments:

The name should be something like php-template-mode.el rather than

  (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".)

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

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

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]