branch: master
commit 8535a686bfdc88cf798f9c575fe681c8f1594932
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>
* Enable MMM in ERB and PHP files with just one extension (#36)
* Mention php-mode installation requirement
---
mmm-defaults.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/mmm-defaults.el b/mmm-defaults.el
index d75c21d..acc5e26 100644
--- a/mmm-defaults.el
+++ b/mmm-defaults.el
@@ -23,11 +23,13 @@
;;; Commentary:
-;; Just add the following line to your init file to enable multiple mode
-;; support in ERB, EJS and PHP files:
+;; To enable multiple mode support in ERB, EJS and PHP files, just add the
+;; following line to your init file:
;;
;; (require 'mmm-defaults)
;;
+;; Note that for PHP you still need to have php-mode (installed separately).
+;;
;; TODO: Add more file types and classes here. Mention this file in README.
;;; Code:
@@ -38,12 +40,13 @@
;;; ERB and EJS
-(mmm-add-mode-ext-class 'html-erb-mode "\\.html\\.erb\\'" 'erb)
-(mmm-add-mode-ext-class 'html-erb-mode "\\.jst\\.ejs\\'" 'ejs)
+(mmm-add-mode-ext-class 'html-erb-mode "\\.erb\\'" 'erb)
+(mmm-add-mode-ext-class 'html-erb-mode "\\.ejs\\'" 'ejs)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-js)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-css)
(add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . html-erb-mode))
+(add-to-list 'auto-mode-alist '("/[^.]+\\.erb\\'" . html-erb-mode))
(add-to-list 'auto-mode-alist '("\\.jst\\.ejs\\'" . html-erb-mode))
;;; PHP
@@ -52,6 +55,7 @@
(mmm-add-mode-ext-class 'html-mode nil 'html-css)
(mmm-add-mode-ext-class 'html-mode "\\.php\\'" 'html-php)
(add-to-list 'auto-mode-alist '("\\.html\\.php\\'" . html-mode))
+(add-to-list 'auto-mode-alist '("/[^.]+\\.php\\'" . html-mode))
(provide 'mmm-defaults)