Use 'web-mode' if available.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 14 Mar 2013 23:05:34 +0200
changeset 1026 ce279dbcf880
parent 1025 3d524b2cbbc1
child 1027 53633ac1c134
Use 'web-mode' if available.
.emacs-my
--- a/.emacs-my	Sat Feb 16 23:38:46 2013 +0200
+++ b/.emacs-my	Thu Mar 14 23:05:34 2013 +0200
@@ -2500,6 +2500,20 @@
 (eval-after-load 'rng-loc '(add-to-list 'rng-schema-locating-files "~/.emacs.d/rnc/schemas.xml"))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(message "web-mode")
+
+(ignore-errors (require 'web-mode))
+(when (featurep 'web-mode)
+  (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) )
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "psgml")
 
 (setq my-html-template
@@ -2546,7 +2560,8 @@
           ("--%\\(>\\)" (1 "> b"))))
   (setcdr (assoc 'font-lock-syntactic-keywords font-lock-defaults) 'jsp-font-lock-syntactic-keywords) )
 
-(add-to-list 'auto-mode-alist '("\\.jspf?\\'" . jsp-mode))
+(unless (featurep 'web-mode)
+  (add-to-list 'auto-mode-alist '("\\.jspf?\\'" . jsp-mode)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "sh, bash")