]> code.delx.au - gnu-emacs/blobdiff - lisp/generic-x.el
*** empty log message ***
[gnu-emacs] / lisp / generic-x.el
index bb8d91be9dfa752c8ee8baca63b8cfbb0c174402..a13103edb3d701eefb6dac6e4f5fc8607ae72750 100644 (file)
@@ -178,16 +178,6 @@ This hook will be installed if the variable
        (goto-char (point-min))
        (default-generic-mode)))))
 
-(defun generic-mode-ini-file-find-file-hook ()
-  "Hook function to enter Default-Generic mode automatically for INI files.
-Done if the first few lines of a file in Fundamental mode look like an
-INI file.  This hook is NOT installed by default."
-  (and (eq major-mode 'fundamental-mode)
-       (save-excursion
-        (goto-char (point-min))
-        (and (looking-at "^\\s-*\\[.*\\]")
-             (ini-generic-mode)))))
-
 (and generic-use-find-file-hook
     (add-hook 'find-file-hook 'generic-mode-find-file-hook))
 
@@ -375,8 +365,21 @@ generic-x to enable the specified modes."
       (setq imenu-generic-expression
            '((nil "^\\[\\(.*\\)\\]" 1)
              ("*Variables*" "^\\s-*\\([^=]+\\)\\s-*=" 1))))))
-  "Generic mode for MS-Windows INI files."
-  :group 'generic-x))
+  "Generic mode for MS-Windows INI files.
+You can use `ini-generic-mode-find-file-hook' to enter this mode
+automatically for INI files whose names do not end in \".ini\"."
+  :group 'generic-x)
+
+(defun ini-generic-mode-find-file-hook ()
+  "Hook function to enter Ini-Generic mode automatically for INI files.
+Done if the first few lines of a file in Fundamental mode look
+like an INI file.  You can add this hook to `find-file-hook'."
+  (and (eq major-mode 'fundamental-mode)
+       (save-excursion
+        (goto-char (point-min))
+        (and (looking-at "^\\s-*\\[.*\\]")
+             (ini-generic-mode)))))
+(defalias 'generic-mode-ini-file-find-file-hook 'ini-generic-mode-find-file-hook))
 
 ;;; Windows REG files
 ;;; Unfortunately, Windows 95 and Windows NT have different REG file syntax!
@@ -487,6 +490,7 @@ generic-x to enable the specified modes."
     (compile
      (concat (w32-shell-name) " -c " (buffer-file-name)))))
 
+(eval-when-compile (require 'comint))
 (defun bat-generic-mode-run-as-comint ()
   "Run the current BAT file in a comint buffer."
   (interactive)
@@ -876,7 +880,7 @@ generic-x to enable the specified modes."
      '("^#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
        (1 font-lock-constant-face)
        (2 font-lock-variable-name-face nil t))))
-    '("\\.[rR][cC]$")
+    '("\\.[rR][cC]\\'")
     nil
     "Generic mode for MS-Windows Resource files."
     :group 'generic-x))
@@ -1497,7 +1501,7 @@ generic-x to enable the specified modes."
      (generic-make-keywords-list
       installshield-funarg-constants-list
       font-lock-variable-name-face "[^_]" "[^_]"))) ; is this face the best choice?
-  '("\\.[rR][uU][lL]$")
+  '("\\.[rR][uU][lL]\\'")
   '(generic-rul-mode-setup-function)
   "Generic mode for InstallShield RUL files."
   :group 'generic-x)
@@ -1675,8 +1679,8 @@ generic-x to enable the specified modes."
     "auto"
     "ignore")
   '(("^\\([/-A-Za-z0-9_]+\\)\\s-+\\([/-A-Za-z0-9_]+\\)"
-     (1 font-lock-type-face)
-     (2 font-lock-variable-name-face)))
+     (1 font-lock-type-face t)
+     (2 font-lock-variable-name-face t)))
   '("/etc/[v]*fstab\\'")
   (list
    (function
@@ -1758,7 +1762,7 @@ generic-x to enable the specified modes."
   ;; List of additional font-lock-expressions
   '(("\\([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 automode-alist expressions
+  ;; List of additional auto-mode-alist expressions
   nil
   ;; List of set up functions to call
   nil
@@ -1779,7 +1783,7 @@ generic-x to enable the specified modes."
   '("nameserver" "domain" "search" "sortlist" "options")
   ;; List of additional font-lock-expressions
   nil
-  ;; List of additional automode-alist expressions
+  ;; List of additional auto-mode-alist expressions
   '("/etc/resolv[e]?.conf\\'")
   ;; List of set up functions to call
   nil