]> code.delx.au - gnu-emacs/blobdiff - lisp/generic-x.el
Merge from trunk.
[gnu-emacs] / lisp / generic-x.el
index 07d407c76503ae50dd975dad54c1b4512df33e75..5205a6811f6fa6ba54e69593038b3eb0ec3d39f0 100644 (file)
@@ -1,11 +1,11 @@
 ;;; generic-x.el --- A collection of generic modes
 
-;; Copyright (C) 1997, 1998, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2011  Free Software Foundation, Inc.
 
 ;; Author:  Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Tue Oct 08 1996
 ;; Keywords: generic, comment, font-lock
+;; Package: emacs
 
 ;; This file is part of GNU Emacs.
 
@@ -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,13 +371,22 @@ 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)
 
 (define-generic-mode hosts-generic-mode
   '(?#)
   '("localhost")
-  '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 font-lock-constant-face))
+  '(("\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" 1 font-lock-constant-face))
   '("[hH][oO][sS][tT][sS]\\'")
   nil
   "Generic mode for HOSTS files."))
@@ -508,8 +518,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
      '("^[ \t]*\\(:\\sw+\\)"         1 font-lock-function-name-face t)
      '("\\(%\\sw+%\\)"               1 font-lock-variable-name-face t)
      '("\\(%[0-9]\\)"                1 font-lock-variable-name-face t)
-     '("\\(/[^/ \"\t\n]+\\)"         1 font-lock-type-face)
-     '("[\t ]+\\([+-][^\t\n\" ]+\\)" 1 font-lock-type-face)
+     '("[\t ]+\\([+-/][^\t\n\" ]+\\)" 1 font-lock-type-face)
      '("[ \t\n|]\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(\\sw+\\)?"
        (1 font-lock-keyword-face)
        (2 font-lock-function-name-face nil t))
@@ -534,7 +543,7 @@ 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)))))
@@ -546,9 +555,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
   (require 'comint)
   (let* ((file (buffer-file-name))
         (buf-name (concat "*" file "*")))
-    (save-excursion
-      (set-buffer
-       (get-buffer-create buf-name))
+    (with-current-buffer (get-buffer-create buf-name)
       (erase-buffer)
       (comint-mode)
       (comint-exec
@@ -1698,6 +1705,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
     "efs"
     "ext2"
     "ext3"
+    "ext4"
     "hfs"
     "hpfs"
     "iso9660"
@@ -1715,6 +1723,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
     "cifs"
     "usbdevfs"
     "sysv"
+    "sysfs"
     "tmpfs"
     "udf"
     "ufs"
@@ -1775,8 +1784,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
     (t (:weight bold)))
   "Font Lock mode face used to highlight TABs."
   :group 'generic-x)
-;; backward-compatibility alias
-(put 'show-tabs-tab-face 'face-alias 'show-tabs-tab)
+(define-obsolete-face-alias 'show-tabs-tab-face 'show-tabs-tab "22.1")
 
 (defface show-tabs-space
   '((((class grayscale) (background light)) (:background "DimGray"   :weight bold))
@@ -1786,8 +1794,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
     (t (:weight bold)))
   "Font Lock mode face used to highlight spaces."
   :group 'generic-x)
-;; backward-compatibility alias
-(put 'show-tabs-space-face 'face-alias 'show-tabs-space)
+(define-obsolete-face-alias 'show-tabs-space-face 'show-tabs-space "22.1")
 
 (define-generic-mode show-tabs-generic-mode
   nil ;; no comment char
@@ -1811,7 +1818,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
   '("cache" "primary" "secondary" "forwarders" "limit" "options"
     "directory" "check-names")
   ;; List of additional font-lock-expressions
-  '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 font-lock-constant-face)
+  '(("\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" 1 font-lock-constant-face)
     ("^directory\\s-+\\(.*\\)"              1 font-lock-variable-name-face)
     ("^\\(primary\\|cache\\)\\s-+\\([.A-Za-z]+\\)\\s-+\\(.*\\)"
      (2 font-lock-variable-name-face)
@@ -1829,7 +1836,7 @@ like an INI file.  You can add this hook to `find-file-hook'."
   ;; List of keywords
   '("IN" "NS" "CNAME" "SOA" "PTR" "MX" "A")
   ;; List of additional font-lock-expressions
-  '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 font-lock-constant-face)
+  '(("\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" 1 font-lock-constant-face)
     ("^\\([.A-Za-z0-9]+\\)"                 1 font-lock-variable-name-face))
   ;; List of additional auto-mode-alist expressions
   nil
@@ -1996,5 +2003,4 @@ like an INI file.  You can add this hook to `find-file-hook'."
 
 (provide 'generic-x)
 
-;; arch-tag: cde692a5-9ff6-4506-9999-c67999c2bdb5
 ;;; generic-x.el ends here