# Ruby-mode in emacs

**URL:** <https://www.ruby-forum.com/t/ruby-mode-in-emacs/101177>\
**Category:** Ruby\
**Created:** [February 5, 2006, 2:15am UTC](https://www.ruby-forum.com/t/ruby-mode-in-emacs/101177 "2006-02-05T02:15:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [February 5, 2006, 2:15am UTC](https://www.ruby-forum.com/t/ruby-mode-in-emacs/101177/1 "2006-02-05T02:15:09Z")

</div>

Hi,  
I’m new to emacs, just bought a book and started my way into it.  
How could I enable ruby-mode in emacs?  
I copied all 4 \*.el files to C:\emacs-21.3\lisp\progmodes, and enabled  
_global font lock_ (through the menu)  
I have the syntax coloring but not auto-complete or anything else.  
How do I enable auto-complete? and is there another features in these  
modes?

Thanks,

- H

Here is my .emacs file:  
(autoload 'ruby-mode “ruby-mode” “Ruby editing mode.” t)  
(setq auto-mode-alist (cons '("\.rb$" . ruby-mode) auto-mode-alist))

(custom-set-variables  
;; custom-set-variables was added by Custom – don’t edit or cut/paste  
it!  
;; Your init file should contain only one such instance.  
'(case-fold-search t)  
'(current-language-environment “Latin-1”)  
'(default-input-method “latin-1-prefix”)  
'(global-font-lock-mode t nil (font-lock)))  
(custom-set-faces  
;; custom-set-faces was added by Custom – don’t edit or cut/paste it!  
;; Your init file should contain only one such instance.  
)

---

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [February 5, 2006, 2:15am UTC](https://www.ruby-forum.com/t/ruby-mode-in-emacs/101177/2 "2006-02-05T02:15:13Z")

</div>

From: Human D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: ruby-mode in emacs  
Date: Sun, 5 Feb 2006 09:00:09 +0900

> I have the syntax coloring but not auto-complete or anything else.  
> How do I enable auto-complete? and is there another features in these modes?

Do you complete Ruby tokens like emacs-lisp?

If you want to complete Ruby tokens, use exuberant ctags.

First make `TAGS’, the tag file.  
$ ctags -e \*.rb

Then enable the tag file.  
M-x visit-tags-table

(defun ruby-mode-hook0 ()  
(define-key ruby-mode-map “\M-\C-i” 'complete-tag)  
)

(add-hook 'inferior-ruby-mode-hook 'inferior-ruby-mode-hook0)

And if you want to complete in inferior-ruby-mode, you can use irbsh.  
Irbsh extends inferior-ruby-mode to enable you to complete Ruby tokens,  
and to execute shell commands.

[http://www.rubyist.net/~rubikitch/computer/irbsh/index.en.html](http://www.rubyist.net/~rubikitch/computer/irbsh/index.en.html)

---

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [February 15, 2006, 6:36am UTC](https://www.ruby-forum.com/t/ruby-mode-in-emacs/101177/3 "2006-02-15T06:36:00Z")

</div>

> If you want to complete Ruby tokens, use exuberant ctags.

FWIW the Zeus for Windows IDE provides seamless integration  
with the Exuberant Ctags utility:

[Zeus IDE - Programming environment for Windows developers](http://www.zeusedit.com/ruby.html)

Basically you create a project/workspace, add the source  
files to the project and Zeus will automatically manage  
the updating of the ctags information.

Jussi Jumppanen  
Author: Zeus for Windows IDE  
Note: Zeus is shareware (45 day trial).
