From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bois Francois-Xavier Newsgroups: gmane.emacs.devel Subject: Re: web-mode.el Date: Wed, 13 Jun 2012 10:39:16 +0200 Message-ID: References: <874nqfslig.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1339599839 3690 80.91.229.3 (13 Jun 2012 15:03:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2012 15:03:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 13 17:03: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 1Sep6v-0000Ip-CH for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2012 17:03:53 +0200 Original-Received: from localhost ([::1]:52757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sep6v-0005jW-4W for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2012 11:03:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sej7H-0006YV-Da for emacs-devel@gnu.org; Wed, 13 Jun 2012 04:39:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sej7E-0000EO-On for emacs-devel@gnu.org; Wed, 13 Jun 2012 04:39:50 -0400 Original-Received: from mail-gh0-f169.google.com ([209.85.160.169]:58436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sej76-0000BP-RT; Wed, 13 Jun 2012 04:39:41 -0400 Original-Received: by ghrr18 with SMTP id r18so216276ghr.0 for ; Wed, 13 Jun 2012 01:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=8J/qpo6f8+MX4athpJ+up626xBbOqS/sBFWuLiA75Hc=; b=ZsW04JAZSWapK1L/Hb4uyciDYaXW8RivTsJEwhZg65ALxLetbSVdchx8DUIxwGiMEH R00f31qKHtU6GBspHPUYO2kPHcCwXDguOwK6ptAH7JhuKTZPrZuhIdzMSMOHChZ/uTwk UKORDJbDl8JuiNd95bxoFJrjmj+PYsSTSoEUiyHcgcOsEXuI9IcJ2HvtauaV77JJJPGp UzWiavkdTr3Ycfxc0khudczTiOIgWTHxOC4yqb+YCmwQoVOB4+m/cp2LoIcelXWwTqck fuNuhfSx5fSyQXRiv9rwAIYH2kMB69Xain1yyLWCE5CoiQSSBpBNGBchqbMbU3GKKPYm VJbQ== Original-Received: by 10.50.76.137 with SMTP id k9mr9990769igw.25.1339576776647; Wed, 13 Jun 2012 01:39:36 -0700 (PDT) Original-Received: by 10.50.214.36 with HTTP; Wed, 13 Jun 2012 01:39:16 -0700 (PDT) In-Reply-To: <874nqfslig.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.169 X-Mailman-Approved-At: Wed, 13 Jun 2012 11:03:51 -0400 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:150928 Archived-At: On Wed, Jun 13, 2012 at 9:45 AM, Chong Yidong wrote: > Bois Francois-Xavier 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. =C2=A0The 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. =C2=A0So 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. =C2=A0Here 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. > =C2=A0(defvar web-mode-variable-name-face 'web-mode-variable-name-face > =C2=A0 =C2=A0"Face name to use for variable names.") > > Don't do this. =C2=A0Just define the variable with defface, and use the f= ace > name (a symbol) directly wherever you need the face. =C2=A0(This is menti= oned > 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 fa= ster. > =C2=A0(defun web-mode-reload () > =C2=A0 =C2=A0"Reload web-mode." > =C2=A0 =C2=A0(interactive) > =C2=A0 =C2=A0(unload-feature 'web-mode) > =C2=A0 =C2=A0(web-mode)) It was for me while I was developing. > I'm not sure what this is for, but it's probably not necessary.