In reference to indent ruby code on the fly in emacs, how do I make a minor mode fire up automatically after a major mode is entered?
Basically, when I open a Ruby file (which opens in ruby-mode
), I would like electric-indent-mode
to start up automatically.
Also, I tried installing ruby-end
but it is not working. I copied the ruby-end.rb
into ~/.emacs.d
and added the following into init.el
:
(add-to-list 'load-path "ruby-end")
(require 'ruby-end)
I also ruby-end.pl
and I get the same error. Here is the result of --debug-init
's error:
Debugger entered--Lisp error: (file-error "Cannot open load file" "ruby-end")
2 require(ruby-end)
3 eval-buffer(#<buffer *load*> nil "/Users/nayef/.emacs.d/init.el" nil t) ; Reading at buffer position 1392
4 load-with-code-conversion("/Users/nayef/.emacs.d/init.el" "/Users/nayef/.emacs.d/init.el" t t)
5 load("/Users/nayef/.emacs.d/init" t t)
6 #[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\202;^@\313\307\314\317#\203:^@\320\nB^R$
7 command-line()
8 normal-top-level()
Any ideas? Does anyone have pointers on Ruby on Rails development in Emacs? I use command-line based text Emacs 24.2.1.