]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/ruby-mode.el (auto-mode-alist): Consolidate different
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 21 Jun 2013 23:14:38 +0000 (03:14 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 21 Jun 2013 23:14:38 +0000 (03:14 +0400)
entries into one regexp and add more *file-s.

lisp/ChangeLog
lisp/progmodes/ruby-mode.el

index 64cb8574db36a1457998bc4a9dd413fb707d54fd..966b70ea0bd98c4b08227e6dce8cfff3d9ed6fb9 100644 (file)
@@ -3,6 +3,8 @@
        * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
        keyword-like methods on Kernel and Module with
        font-lock-builtin-face.
+       (auto-mode-alist): Consolidate different entries into one regexp
+       and add more *file-s.
 
 2013-06-21  Stephen Berman  <stephen.berman@gmx.net>
 
index fe44647dcce13932ae9fbd5d2f5763f2b5b393e4..f827b4471362c9b1d833fd1315a679d6bf4279a1 100644 (file)
@@ -1867,11 +1867,15 @@ The variable `ruby-indent-level' controls the amount of indentation.
 ;;; Invoke ruby-mode when appropriate
 
 ;;;###autoload
-(add-to-list 'auto-mode-alist (cons (purecopy "\\.rb\\'") 'ruby-mode))
-;;;###autoload
-(add-to-list 'auto-mode-alist (cons (purecopy "Rakefile\\'") 'ruby-mode))
-;;;###autoload
-(add-to-list 'auto-mode-alist (cons (purecopy "\\.gemspec\\'") 'ruby-mode))
+(add-to-list 'auto-mode-alist
+             (cons (purecopy (concat "\\(?:\\."
+                                     (regexp-opt '("rb" "ru" "rake" "thor"
+                                                   "jbuilder" "gemspec"))
+                                     "\\|/"
+                                     (regexp-opt '("Gemfile" "Rakefile"
+                                                   "Capfile" "Thorfile"
+                                                   "Vagrantfile"))
+                                     "\\)\\'")) 'ruby-mode))
 
 ;;;###autoload
 (dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8"))