Permalink
Browse files

cleanup setup of auto-mode-alist and add Capfile and *.prawn

  • Loading branch information...
1 parent 0d96b5a commit a432395adb9bb0dfb85541090df61dc8597daa2a @remvee committed Mar 4, 2010
Showing with 13 additions and 24 deletions.
  1. +0 −8 README.textile
  2. +13 −16 rails.el
View
@@ -27,14 +27,6 @@ Before you install this package make sure the following dependencies met:
These are installable via the "ELPA":http://tromey.com/elpa/ or using @apt-get install ruby-elisp@. Some Emacs distributions include them by default.
-Ruby mode doesn't know about typical Ruby DSL files so you'll need to give Emacs a hand:
-
-<pre><code> (add-to-list 'auto-mode-alist '("\\.builder$" . ruby-mode))
- (add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
- (add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
- (add-to-list 'auto-mode-alist '("Capfile$" . ruby-mode))
-</code></pre>
-
h3. Rails-minor-mode
View
@@ -536,23 +536,20 @@ necessary."
(if (rails-project:root)
(rails-minor-mode t))))
+(dolist (pair '(("\\.rb$" . ruby-mode)
+ ("\\.rake$" . ruby-mode)
+ ("\\.mab$" . ruby-mode)
+ ("Rakefile$" . ruby-mode)
+ ("Capfile$" . ruby-mode)
+ ("\\.rxml$" . ruby-mode)
+ ("\\.builder$" . ruby-mode)
+ ("\\.rjs$" . ruby-mode)
+ ("\\.prawn$" . ruby-mode)
+ ("\\.rhtml$" . rhtml-mode)
+ ("\\.erb$" . rhtml-mode)))
+ (add-to-list 'auto-mode-alist pair)
+ (modify-coding-system-alist 'file (car pair) 'utf-8))
-(autoload 'haml-mode "haml-mode" "" t)
-
-(setq auto-mode-alist (cons '("\\.rb$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.rake$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.mab$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("Rakefile$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.haml$" . haml-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.rxml$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.builder$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.rjs$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.rhtml$" . rhtml-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.erb$" . rhtml-mode) auto-mode-alist))
-
-(modify-coding-system-alist 'file "\\.rb$" 'utf-8)
-(modify-coding-system-alist 'file "\\.rake$" 'utf-8)
-(modify-coding-system-alist 'file "Rakefile$" 'utf-8)
(modify-coding-system-alist 'file (rails-core:regex-for-match-view) 'utf-8)
;; Some navigation breaks if max-lisp-eval-depth is not high enough, up it if too low

0 comments on commit a432395

Please sign in to comment.