CarbonEmacsでRails開発

Terminalじゃなくても動かせる CarbonEmacsを入れて,Rails開発するためのメモ.Aptana+RadRails入れたんだけど,結局あんまり使ってない.ECBは次回かな.

CarbonEmacs の説明とダウンロードは↓から

Rails開発で必要なもの

これらをロードパス(/usr/share/emacs/site-lisp)の通ったところにおいて .emacs に以下のように書く

(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)

とりあえず今の最低限の.emacs.el

;;; key bind
(global-set-key "\C-u" 'scroll-down)

;;; tool-bar を消す
(tool-bar-mode nil)

;;; 括弧の対応表示
(require 'paren)
(show-paren-mode)

;;; C-h と Backspace の入れ替え
;;; 前一文字削除が Ctrl + h に割当てられます
(keyboard-translate ?\C-h ?\C-?)
(global-set-key "\C-h" nil)

;;; mark 領域に色付け
(setq transient-mark-mode t)

;;; ステータスラインに時間を表示する
(if (equal (substring (concat
       (shell-command-to-string "defaults read -g AppleLocale") "__") 0 2) "ja")
      (progn
       (setq dayname-j-alist
            '(("Sun" . "日") ("Mon" . "月") ("Tue" . "火") ("Wed" . "水")
             ("Thu" . "木") ("Fri" . "金") ("Sat" . "土")))
       (setq display-time-string-forms
             '((format "%s年%s月%s日(%s) %s:%s %s"
                       year month day
                       (cdr (assoc dayname dayname-j-alist))
                       24-hours minutes
                       load)))))
(display-time)

;;; 最終更新日の自動挿入
;;;   ファイルの先頭から 8 行以内に Time-stamp: <> または
;;;   Time-stamp: " " と書いてあれば、セーブ時に自動的に日付が挿入されます
(require 'time-stamp)
(if (not (memq 'time-stamp write-file-functions))
    (setq write-file-functions
   (cons 'time-stamp write-file-functions)))

;;; コマンド、コントロール、オプションの各キーを
;;; alt, control, hyper, meta, super
;;; の各キーとして利用
(setq mac-command-modifier 'alt)
(setq mac-control-modifier 'control)
(setq mac-option-modifier 'meta)

(cua-selection-mode t)

;;; [Home] Key と [End] Key を従来の動作に戻す
(define-key global-map [home] 'beginning-of-buffer)
(define-key global-map [end] 'end-of-buffer)

;; 半透明化
;(set-alpha '(95 75))
;; color
;(set-background-color "black")
;(set-foreground-color "white")

;;; Rails
(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)