Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

emacs .el files

88 views
Skip to first unread message

Alex Katebi

unread,
Aug 8, 2008, 11:57:36 AM8/8/08
to
[Note: parts of this message were removed to make it a legal post.]

Hi All,
It would be nice if there was a README file in the "ruby/misc" directory
on how to apply the emacs .el files to .emacs.
I copied all the .el files into the /usr/share/emacs/site-list/site-start.d
directory. But I don't know how to auto load and enable these features from
emacs or
from site-start.el. Could someone help me?

Thanks,
-Alex

Eric Schulte

unread,
Aug 8, 2008, 12:08:39 PM8/8/08
to
the following two lines should get you going, the first line is only
necessary if you have not already placed the files in your site-lisp
directory

(add-to-list 'load-path "~/path/to/directory/containing/ruby-mode.el")
(autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files" t)

if you're feeling ambitious about adding more functionality here is an
excerpt from my own site-start.el

-- Eric

;;; Ruby Mode
;;;
;;; and
;;;
;;; Inferior Ruby Mode - ruby process in a buffer.
;;; adapted from cmuscheme.el
(add-to-list 'load-path "~/emacs/elisp/ruby-mode")
;;; (1) modify .emacs to use ruby-mode
(autoload 'ruby-mode "ruby-mode"
"Mode for editing ruby source files" t)
(setq auto-mode-alist
(append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
(setq auto-mode-alist
(append '(("\\.rjs$" . ruby-mode)) auto-mode-alist))
(setq auto-mode-alist
(append '(("\\.rake$" . ruby-mode)) auto-mode-alist))
(setq auto-mode-alist
(append '(("Rakefile$" . ruby-mode)) auto-mode-alist))
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
interpreter-mode-alist))
;;; (2) set to load inf-ruby and set inf-ruby key definition in ruby-mode.
(autoload 'run-ruby "inf-ruby"
"Run an inferior Ruby process")
(set 'ruby-program-name "irb --inf-ruby-mode -rubygems")
(autoload 'inf-ruby-keys "inf-ruby"
"Set local key defs for inf-ruby in ruby-mode")
(add-hook 'inferior-ruby-mode-hook
(lambda ()
(local-set-key "\C-cd" 'ri)
(local-set-key [tab] 'ri-ruby-complete-symbol)
(local-set-key "\C-c\C-a" 'ri-ruby-show-args)))

;;; Ruby Debugger
(autoload 'rubydb "rubydb3x" "Ruby debugger" t)

;;; Ruby Style
(require 'ruby-style)

;; Tab Completion
(require 'pabbrev)
(add-hook 'ruby-mode-hook
'(lambda ()
(pabbrev-mode)))

;;; ri (ruby interactive documentation)
;;
;; http://rubyforge.org/projects/ri-emacs
;;
(setq ri-ruby-script (expand-file-name "~/emacs/elisp/ruby-mode/ri-emacs.rb"))
(autoload 'ri "~/emacs/elisp/ruby-mode/ri-ruby.el" nil t)
(load "~/emacs/elisp/ruby-mode/ri-ruby.el")
;; Bind the ri command to a key.
;; Method/class completion is also available.
(add-hook 'ruby-mode-hook
(lambda ()
(local-set-key "\C-cd" 'ri)
(local-set-key (kbd "<C-return>") 'ri-ruby-complete-symbol)
(local-set-key "\C-c\C-a" 'ri-ruby-show-args)
))


On Saturday, August 9, at 00:57, Alex Katebi wrote:
> Hi All,
> It would be nice if there was a README file in the "ruby/misc" directory
> on how to apply the emacs .el files to .emacs.
> I copied all the .el files into the /usr/share/emacs/site-list/site-start.d
> directory. But I don't know how to auto load and enable these features from

> .emacs or


> from site-start.el. Could someone help me?
>
> Thanks,
> -Alex

--
schulte

Alex Katebi

unread,
Aug 8, 2008, 12:36:42 PM8/8/08
to
[Note: parts of this message were removed to make it a legal post.]

Hello Eric,

I did the whole thing and it works great!

Thanks,
-Alex

0 new messages