rails.el を最新にしてみた

もうなんというかアレですよ。
入れたら入れたで入れっななし。
yumとかaptとかにお世話になりっぱなし。
使ってるRailsも1.2.3ですよ。

そろそろまた復活してみようかなぁと思いとりあえずrails.elの環境を整える所から。

現状調査

$ ls -la /home/hana-da/.emacs.d/site-lisp/rails
total 128
drwxr-xr-x 2 hana-da users  4096 Dec 10 12:15 ./
drwxr-xr-x 3 hana-da users  4096 Dec 10 12:15 ../
-rw-r--r-- 1 hana-da users 16105 Apr 20  2006 rails-core.el
-rw-r--r-- 1 hana-da users  6608 Apr 20  2006 rails-for-controller.el
-rw-r--r-- 1 hana-da users  1114 Apr 20  2006 rails-for-layout.el
-rw-r--r-- 1 hana-da users  7269 Apr 20  2006 rails-for-rhtml.el
-rw-r--r-- 1 hana-da users  6646 Apr 20  2006 rails-lib.el
-rw-r--r-- 1 hana-da users 12372 Apr 20  2006 rails-navigation.el
-rw-r--r-- 1 hana-da users  1433 Apr 20  2006 rails-ruby.el
-rw-r--r-- 1 hana-da users  6867 Apr 20  2006 rails-scripts.el
-rw-r--r-- 1 hana-da users 21264 Apr 20  2006 rails-ui.el
-rw-r--r-- 1 hana-da users  5242 Apr 20  2006 rails-webrick.el
-rw-r--r-- 1 hana-da users 13493 Apr 20  2006 rails.el

2年半放置です。


$ head rails.el
;;; rails.el --- minor mode for editing RubyOnRails code

;; Copyright (C) 2006 Galinsky Dmitry <dima dot exe at gmail dot com>

;; Authors: Galinsky Dmitry <dima dot exe at gmail dot com>,
;;          Rezikov Peter <crazypit13 (at) gmail.com>

;; Keywords: ruby rails languages oop
;; $URL: svn+ssh://crazypit@rubyforge.org/var/svn/emacs-rails/trunk/rails.el $
;; $Id: rails.el 49 2006-04-19 20:01:13Z crazypit $
$ grep version rails.el
;; as published by the Free Software Foundation; either version 2
;; of the License, or (at your option) any later version.
(defvar rails-version "0.39")

だそうです。


最新版をダウンロードして展開

http://rubyforge.org/projects/emacs-rails/ を見てみると最新はemacs-rails-0.5.99.5.tar.gz
っぽいのでそれをダウンロード。

この2つは最新がもう入ってるっぽいのでこのままで。

ほんでもって展開
$ tar zxvf ~/closet/tar.gz/emacs-rails-0.5.99.5.tar.gz
emacs-rails/
emacs-rails/ChangeLog
emacs-rails/History
emacs-rails/inflections.el
emacs-rails/predictive-prog-mode.el
emacs-rails/rails-bytecompile.el
:
READMEを読んでみましょう。
You can also use SVN

  cd  $HOME/.emacs.d/
  svn co svn://rubyforge/var/svn/emacs-rails/trunk emacs-rails

あ、SVNでもよかったんだ。ま、いっか。


必要要件

*Alert:* From 0.44 release emacs-rails will require the
 "inf-ruby":inf-ruby.

えーっと。inf-rubyってなんだっけか?

$ locate inf-ruby
/usr/share/emacs/site-lisp/ruby-mode/inf-ruby.el
/usr/share/emacs-21.4/site-lisp/ruby-mode/inf-ruby.elc

あるっぽいからいいか。

.emacs.el

.emacs.elには

(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))
(setq rails-use-mongrel t)
(require 'rails)

と既に書いてあるのでこのままで行けるはず。

起動

error: "emacs-rails require CVS version of Emacs (future Emacs 22), and not be running on your Emacs 21.4"

To ensure normal operation, you should investigate the cause
of the error in your initialization file and remove it.  Start
Emacs with the `--debug-init' option to view a complete error
backtrace

って、ゆわれた。

$ emacs --version
GNU Emacs 21.4.1
Copyright (C) 2002 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

ダメなの?ねぇダメなの???




http://wota.jp/ac/?date=20060508

そうですか。時代は emacs-rails-0.39 + emacs22 ですか。。。って2年以上前のエントリですな。

$ apt-cache search emacs22
emacs22 - GNU Emacs エディタ

あるっぽいので入れてみますか。

$ sudo apt-get install emacs22
:
$ file /etc/alternatives/emacs
/etc/alternatives/emacs: symbolic link to `/usr/bin/emacs-22.0.50'

なんか入ったっぽいので起動

上った。。。ってか、なんかカッコイイ!!!

だってほら21.4の時は

スクロールバーとか違うし。
mewでうまく動かなかった _ とか、ちゃんと動くし! 感激。

あ、当然 emacs-railsも動きましたよ。