]> code.delx.au - gnu-emacs/blobdiff - lisp/generic-x.el
Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca
[gnu-emacs] / lisp / generic-x.el
index e23af4dff78e7297db085ff4d8c45de01f60f5bc..d0250cb5210eb8eceafa92152f67b2f89a200ebc 100644 (file)
@@ -1,6 +1,6 @@
 ;;; generic-x.el --- A collection of generic modes
 
-;; Copyright (C) 1997-1998, 2001-201 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2013 Free Software Foundation, Inc.
 
 ;; Author:  Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Tue Oct 08 1996
@@ -28,7 +28,7 @@
 ;;
 ;; INSTALLATION:
 ;;
-;; Add this line to your .emacs file:
+;; Add this line to your init file:
 ;;
 ;;   (require 'generic-x)
 ;;
@@ -229,7 +229,8 @@ This hook will be installed if the variable
     prototype-generic-mode
     resolve-conf-generic-mode
     samba-generic-mode
-    x-resource-generic-mode)
+    x-resource-generic-mode
+    xmodmap-generic-mode)
   "List of generic modes that are defined by default on Unix.")
 
 (defconst generic-other-modes
@@ -370,6 +371,15 @@ your changes into effect."
   nil
   "Generic mode for X Resource configuration files."))
 
+(if (memq 'xmodmap-generic-mode generic-extras-enable-list)
+(define-generic-mode xmodmap-generic-mode
+  '(?!)
+  '("add" "clear" "keycode" "keysym" "remove" "pointer")
+  nil
+  '("[xX]modmap\\(rc\\)?\\'")
+  nil
+  "Simple mode for xmodmap files."))
+
 ;;; Hosts
 (when (memq 'hosts-generic-mode generic-extras-enable-list)
 
@@ -533,12 +543,15 @@ like an INI file.  You can add this hook to `find-file-hook'."
   (interactive)
   (let ((compilation-buffer-name-function
         (function
-         (lambda(ign)
+         (lambda (_ign)
            (concat "*" (buffer-file-name) "*")))))
     (compile
      (concat (w32-shell-name) " -c " (buffer-file-name)))))
 
 (eval-when-compile (require 'comint))
+(declare-function comint-mode "comint" ())
+(declare-function comint-exec "comint" (buffer name command startfile switches))
+
 (defun bat-generic-mode-run-as-comint ()
   "Run the current BAT file in a comint buffer."
   (interactive)
@@ -636,83 +649,10 @@ like an INI file.  You can add this hook to `find-file-hook'."
   "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)
@@ -1426,7 +1366,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
     "REGDB_APPPATH"
     "REGDB_BINARY"
     "REGDB_ERR_CONNECTIONEXISTS"
-    "REGDB_ERR_CORRUPTEDREGSITRY"
+    "REGDB_ERR_CORRUPTEDREGISTRY"
     "REGDB_ERR_INITIALIZATION"
     "REGDB_ERR_INVALIDHANDLE"
     "REGDB_ERR_INVALIDNAME"
@@ -1436,7 +1376,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
     "REGDB_STRING"
     "REGDB_UNINSTALL_NAME"
     "REMOTE_DRIVE"
-    "REMOVALE_DRIVE"
+    "REMOVEABLE_DRIVE"
     "REPLACE_ITEM"
     "REPLACE"
     "RESET"
@@ -1521,15 +1461,15 @@ like an INI file.  You can add this hook to `find-file-hook'."
      '("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"
        1 font-lock-string-face)
      '("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
-       (1 font-lock-reference-face)
+       (1 font-lock-constant-face)
        (2 font-lock-variable-name-face nil t))
      ;; indirect string constants
      '("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face)
      ;; gotos
-     '("[ \t]*\\(\\sw+:\\)"           1 font-lock-reference-face)
+     '("[ \t]*\\(\\sw+:\\)"           1 font-lock-constant-face)
      '("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?"
        (1 font-lock-keyword-face)
-       (2 font-lock-reference-face nil t))
+       (2 font-lock-constant-face nil t))
      ;; system variables
      (generic-make-keywords-list
       installshield-system-variables-list
@@ -1695,6 +1635,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
     "efs"
     "ext2"
     "ext3"
+    "ext4"
     "hfs"
     "hpfs"
     "iso9660"
@@ -1712,6 +1653,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
     "cifs"
     "usbdevfs"
     "sysv"
+    "sysfs"
     "tmpfs"
     "udf"
     "ufs"