# Emacs rails 0.39

**URL:** <https://www.ruby-forum.com/t/emacs-rails-0-39/58243>\
**Category:** Rails\
**Created:** [April 19, 2006, 11:16pm UTC](https://www.ruby-forum.com/t/emacs-rails-0-39/58243 "2006-04-19T23:16:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rezikov\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/43a26b/32.png) [@Rezikov\_P](https://www.ruby-forum.com/u/Rezikov_P)\
**Post date:** [April 19, 2006, 11:16pm UTC](https://www.ruby-forum.com/t/emacs-rails-0-39/58243/1 "2006-04-19T23:16:37Z")

</div>

Testing version of Emacs Rails  
([http://rubyforge.org/projects/emacs-rails/](http://rubyforge.org/projects/emacs-rails/))  
was released. If you have some suggestion or you find some bugs please  
inform us.

Features:

- Management of WEBrick/Mongrel
- Display color log file
- Toggle Switch between Action/View and other file (tests, helpers)  
automaticly or with menu
- Switching to file from current line f.e. from redirect\_to :controller  
=\>  
“foo”, :action =\> “bar”, swtich to this controller/action
- TextMate-like snippets (snippets.el)
- ERb refactoring (create partial from selection, create helper from  
block)
- Automatic TAGS generation in RAILS\_ROOT directory
- Quick access to the main configuration files
- Documentation search using ri or chm file and Rails API reference in  
HTML
- Quick start svn-status in RAILS\_ROOT
- Integration with script/generate script/destroy (controller, model,  
scaffold, migration)
- Goto menus for quick access to controllers, models, and other.
- Auto-determination of current rails DB settings and running SQL  
console
- Automatic openning browser on current action (from view or controller)
- Integration with interactive scripts script/console and  
script/breakpointer
- Fast navigation in Rails root hierarchy (rails finds - C-c f )
- Fast running of rails rake with autocomplete

and some other.

Also you can find some non-completed review of Emacs Rails in  
[http://rubyforge.org/docman/?group\_id=1484](http://rubyforge.org/docman/?group_id=1484).

---

<div class="post-metadata">

**Author:** ![Rezikov\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/43a26b/32.png) [@Rezikov\_P](https://www.ruby-forum.com/u/Rezikov_P)\
**Post date:** [April 20, 2006, 12:45am UTC](https://www.ruby-forum.com/t/emacs-rails-0-39/58243/2 "2006-04-20T00:45:25Z")

</div>

May you post your .emacs file, please?

Thanks in advance,

- Dunnil

---

<div class="post-metadata">

**Author:** ![Rezikov\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/43a26b/32.png) [@Rezikov\_P](https://www.ruby-forum.com/u/Rezikov_P)\
**Post date:** [April 20, 2006, 8:14am UTC](https://www.ruby-forum.com/t/emacs-rails-0-39/58243/3 "2006-04-20T08:14:37Z")

</div>

This is a piece of code from my emacs configuration file for RoR:

;;;;;;;;;;;;;;;;;;;; Rails ;;;;;;;;;;;;;;;;;;;;

(add-to-list 'load-path “/home/cp/proj/emacs-rails/trunk/”)

(defun try-complete-abbrev (old)  
(if (expand-abbrev) t nil))

(setq hippie-expand-try-functions-list  
'(try-complete-abbrev  
try-complete-file-name  
try-expand-dabbrev))

(require 'rails)  
(setf rails-api-root “/home/cp/doc/programming/ruby/rails/doc/api/”)

(defun rails-find-and-goto-error ()  
"Finds error in rails html log ang go to file/line with error "  
(interactive)  
(search-forward-regexp “RAILS\_ROOT: \([^\<]_\)")  
(let ((rails-root (concat (match-string 1) “/”)))  
(search-forward “id="Application-Trace"”)  
(search-forward “RAILS\_ROOT}”)  
(search-forward-regexp "\([^:]_\):\([0-9]+\)”)  
(let ((file (match-string 1))  
(line (match-string 2)))  
(kill-buffer (current-buffer))  
(message  
(format "Error finded in file "%s" on %s line. " file line))  
(find-file (concat rails-root file))  
(goto-line (string-to-int line)))))

(setf rails-find-file-function 'ido-find-file)

(setf rails-use-text-menu nil)  
(GNUEmacs  
(modify-coding-system-alist 'file “\.rhtml$” 'utf-8)  
(modify-coding-system-alist 'file “\.rb$” 'utf-8))  
(setf rails-tags-command “ctags-exuberant -e -a --Ruby-kinds=-f -o %s  
-R  
%s”)  
(defadvice browse-url (before switch-to-firefox  
activate compile)  
“Switch to firefox after openning a URL”  
(shell-command “FvwmCommand "GoToDesk 0 2"”))

(require 'mmm-mode)  
(require 'mmm-auto)  
(setq mmm-global-mode 'maybe)  
(setq mmm-submode-decoration-level 2)  
(set-face-background 'mmm-output-submode-face “#080012”)  
(set-face-background 'mmm-code-submode-face “Black”)  
;; (set-face-background 'mmm-comment-submode-face “DarkOliveGreen”)  
(mmm-add-classes  
'((erb-code  
:submode ruby-mode  
:match-face ((“\<%#” . mmm-comment-submode-face)  
(“\<%=” . mmm-output-submode-face)  
(“\<%” . mmm-code-submode-face))  
:front “\<%[#=]?”  
:back “%\>”  
:insert ((?% erb-code nil @ “\<%” @ " " \_ " " @ “%\>” @)  
(?# erb-comment nil @ “\<%#” @ " " \_ " " @ “%\>” @)  
(?= erb-expression nil @ “\<%=” @ " " \_ " " @ “%\>” @)))))

(add-hook 'html-mode-hook  
(lambda ()  
(local-set-key (kbd “”) 'mmm-parse-buffer)  
(setq mmm-classes '(erb-code))  
(mmm-mode)))

2006/4/20, Human D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Rezikov\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/43a26b/32.png) [@Rezikov\_P](https://www.ruby-forum.com/u/Rezikov_P)\
**Post date:** [April 20, 2006, 10:11am UTC](https://www.ruby-forum.com/t/emacs-rails-0-39/58243/4 "2006-04-20T10:11:23Z")

</div>

2006/4/20, Calle D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> - Please fix your tar.gz file so it doesn’t expand to the current  
> directory, but to a subdir.

- It would be nice if the README file was readable with “more” from

> the command line (I see nothing in it that doesn’t fit in plain old  
> ASCII).

OK, i fix that.

- All key combinations of the form C-c are reserved for the

> user and should not be used by major or minor modes. Se the GNU  
> Emacs Lisp Reference Manual, Appendix D, section 1, point 10. You  
> break this rather a lot in rails-ui.el

I was not knew this… This task now in TODO.

---

<div class="post-metadata">

**Author:** ![Rezikov\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/43a26b/32.png) [@Rezikov\_P](https://www.ruby-forum.com/u/Rezikov_P)\
**Post date:** [April 20, 2006, 9:40am UTC](https://www.ruby-forum.com/t/emacs-rails-0-39/58243/5 "2006-04-20T09:40:11Z")

</div>

> > > > > “Rezikov” == Rezikov P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> Testing version of Emacs Rails ([http://rubyforge.org/projects/emacs-rails/](http://rubyforge.org/projects/emacs-rails/))  
> was released. If you have some suggestion or you find some bugs please  
> inform us.

- Please fix your tar.gz file so it doesn’t expand to the current  
directory, but to a subdir.

- It would be nice if the README file was readable with “more” from  
the command line (I see nothing in it that doesn’t fit in plain old  
ASCII).

- All key combinations of the form C-c are reserved for the  
user and should not be used by major or minor modes. Se the GNU  
Emacs Lisp Reference Manual, Appendix D, section 1, point 10. You  
break this rather a lot in rails-ui.el  
–  
Calle D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://www.livejournal.com/users/cdybedahl/](http://www.livejournal.com/users/cdybedahl/)  
“You know, if I garbage collected my brain I wouldn’t have anything  
left.”  
– Paul Tomblin, BofhNet
