Skip to content

Commit

Permalink
Add mmm-defaults.el (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutov committed Oct 27, 2013
1 parent cc0e3d9 commit 3d83b62
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions mmm-defaults.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
;;; mmm-defaults.el --- Friendly defaults for MMM Mode

;; Copyright (C) 2013 by Dmitry Gutov

;; Author: Dmitry Gutov <dgutov@yandex.ru>

;;{{{ GPL

;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;; Just add the following line to your init file to enable multiple mode
;; support in ERB, EJS and PHP files:
;;
;; (require 'mmm-defaults)
;;
;; TODO: Add more file types and classes here. Mention this file in README.

;;; Code:

(require 'mmm-auto)

(setq mmm-global-mode 'auto)

;;; 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 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 '("\\.jst\\.ejs\\'" . html-erb-mode))

;;; PHP

(mmm-add-mode-ext-class 'html-mode nil 'html-js)
(mmm-add-mode-ext-class 'html-mode nil 'html-css)
(mmm-add-mode-ext-class 'html-mode nil 'html-php)
(add-to-list 'auto-mode-alist '("\\.html\\.php\\'" . html-mode))

(provide 'mmm-defaults)

;;; mmm-defaults.el ends here

0 comments on commit 3d83b62

Please sign in to comment.