all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: javascript-generic-mode vs js-mode
Date: Mon, 8 Oct 2012 17:20:35 +0200	[thread overview]
Message-ID: <CAAeL0SSDMpBqS+bAim7Bg28cs0x-rW=7k8KuOQt5Yv4XMrz3_g@mail.gmail.com> (raw)

Emacs has a proper JavaScript mode (js.el) since 2009.

Does it make sense to keep javascript-generic-mode from generic-x.el?
It's a poor man's js-mode and it hides js-mode in auto-mode-alist if
you require generic-x.el and forget or ignore js.el.

I'd suggest just removing it and obsolete-aliasing it to js-mode.

    Juanma



@@ -646,83 +646,10 @@
   "Generic mode for Sys V pkginfo files."))

 ;; Javascript mode
-;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU]
+;; Obsolete; defer to js-mode from js.el.
 (when (memq 'javascript-generic-mode generic-extras-enable-list)
-
-(define-generic-mode javascript-generic-mode
-  '("//" ("/*" . "*/"))
-  '("break"
-    "case"
-    "continue"
-    "default"
-    "delete"
-    "do"
-    "else"
-    "export"
-    "for"
-    "function"
-    "if"
-    "import"
-    "in"
-    "new"
-    "return"
-    "switch"
-    "this"
-    "typeof"
-    "var"
-    "void"
-    "while"
-    "with"
-    ;; words reserved for ECMA extensions below
-    "catch"
-    "class"
-    "const"
-    "debugger"
-    "enum"
-    "extends"
-    "finally"
-    "super"
-    "throw"
-    "try"
-    ;; Java Keywords reserved by JavaScript
-    "abstract"
-    "boolean"
-    "byte"
-    "char"
-    "double"
-    "false"
-    "final"
-    "float"
-    "goto"
-    "implements"
-    "instanceof"
-    "int"
-    "interface"
-    "long"
-    "native"
-    "null"
-    "package"
-    "private"
-    "protected"
-    "public"
-    "short"
-    "static"
-    "synchronized"
-    "throws"
-    "transient"
-    "true")
-  '(("^\\s-*function\\s-+\\([A-Za-z0-9_]+\\)"
-     (1 font-lock-function-name-face))
-    ("^\\s-*var\\s-+\\([A-Za-z0-9_]+\\)"
-     (1 font-lock-variable-name-face)))
-  '("\\.js\\'")
-  (list
-   (function
-    (lambda ()
-      (setq imenu-generic-expression
-	    '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)
-	      ("*Variables*" "^var\\s-+\\([A-Za-z0-9_]+\\)" 1))))))
-  "Generic mode for JavaScript files."))
+  (define-obsolete-function-alias 'javascript-generic-mode 'js-mode "24.3")
+  (define-obsolete-variable-alias 'javascript-generic-mode-hook
'js-mode-hook "24.3"))

 ;; VRML files
 (when (memq 'vrml-generic-mode generic-extras-enable-list)



             reply	other threads:[~2012-10-08 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 15:20 Juanma Barranquero [this message]
2012-10-08 15:47 ` javascript-generic-mode vs js-mode Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAeL0SSDMpBqS+bAim7Bg28cs0x-rW=7k8KuOQt5Yv4XMrz3_g@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.