Set .bat file association if bat-mode provided.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 18 Jan 2009 22:12:56 +0200
changeset 117 e8fec75adcd6
parent 116 8b2e019ee147
child 118 27add777f357
Set .bat file association if bat-mode provided.
.emacs-my
--- a/.emacs-my	Sun Jan 18 21:56:23 2009 +0200
+++ b/.emacs-my	Sun Jan 18 22:12:56 2009 +0200
@@ -575,20 +575,12 @@
 ;; (setq sh-shell-arg (quote ((bash) (csh . "-f") (pdksh) (ksh88) (rc . "-p") (wksh) (zsh . "-f") (sh . "-i"))))
 (setq explicit-bash-args (quote ("-login" "-i")))
 
-
-(if (equal window-system 'w32)
-    (progn
-      (setq auto-mode-alist
-            (append
-             (list (cons "\\.[bB][aA][tT]$" 'bat-mode))
-             ;; For DOS init files
-             (list (cons "CONFIG\\."   'bat-mode))
-             (list (cons "AUTOEXEC\\." 'bat-mode))
-             auto-mode-alist))
-      ;; XXX Wrong!
-      (require 'bat-mode)
-      )
-  )
+(when (provide 'bat-mode)
+  (progn
+    (add-to-list 'auto-mode-alist '("\\.[bB][aA][tT]$" . bat-mode))
+    ;; For DOS init files
+    (add-to-list 'auto-mode-alist '("CONFIG\\." . bat-mode))
+    (add-to-list 'auto-mode-alist '("AUTOEXEC\\." . bat-mode)))
 
 ;; ======================================================================
 ;;