Technical
Rails Ready Emacs For Ubuntu

How to get anti-aliased fonts working in Emacs

(the following basically lifted from http://peadrop.com/blog/2007/01/06/pretty-emacs/

basic steps:

1. wget -quiet http://debs.peadrop.com/DD385D79.gpg -O  | sudo apt-key add -
2. add to /etc/apt/sources.list
deb http://debs.peadrop.com dapper backports
deb-src http://debs.peadrop.com dapper backports
3. sudo apt-get update
4. sudo apt-get install emacs-snapshot-gtk emacs-snapshot-el

add to .emacs:

(set-default-font "Bitstream Vera Sans Mono-14")

YAML mode ¶

(require ‘yaml-mode)

(setq auto-mode-alist (append ‘((”\\.yml$” . yaml-mode)

("\\.yaml$" . yaml-mode))))

Camel Case?

download http://www.cs.ucf.edu/~leavens/emacs/camelCase/camelCase-mode.el

;;;

;;; camelCase

;;;

(autoload ‘camelCase-mode “camelCase-mode” nil t)

(add-hook ‘find-file-hook ‘(lambda () (camelCase-mode 1))) ; all files. (all buffers?)

Emacs-on-Rails ¶

http://dima-exe.ru/rails-on-emacs

cd .elisp

svn checkout svn://rubyforge.org/var/svn/emacs-rails/trunk rails

wget http://www.kazmier.com/computer/snippet.el

wget http://www.webweavertech.com/ovidiu/emacs/find-recursive.txt -O find-recursive.el

wget http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/inf-ruby.el?view=co -O inf-ruby.el

then add to .emacs:

;;;

;;; emacs ruby on rails mode

;;;

(setq load-path (cons ”~/.elisp/rails” load-path))

(require ‘rails)

(add-hook ‘ruby-mode-hook ‘(lambda () (menu-bar-mode 1)))

apply this patch to rails elisp directory:

===================================================================

—- rails-snippets-feature.el (revision 219)

+ rails-snippets-feature.el (working copy)

@ -29,6 +29,7 @

(defconst rails-snippets-feature:list
'((0 "ruby")
(1 "loops" ruby-mode-abbrev-table

+ (“end” ”$>$.\nend” “end”) ;; to avoid expanding when i want to indent

("while" "while $${condition}\n$>$.\nend$>" "while ... end")
("when" "when $${condition}\n$>$." "when ...")
("w" "attr_writer :$${attr_names}" "attr_writer ...")

Index: rails-ui.el

===================================================================

—- rails-ui.el (revision 219)

+ rails-ui.el (working copy)

@ -300,7 +300,7 @

([f1]                  'rails-search-doc)
((kbd "<C-f1>")        'rails-browse-api-at-point)
((rails-key "<f1>")     'rails-browse-api)

- ((rails-key ”/”) ‘rails-script:toggle-output-window)

+;; ((rails-key ”/”) ‘rails-script:toggle-output-window)

([f9]                  'rails-svn-status-into-root))

Index: rails.el

===================================================================

—- rails.el (revision 219)

+ rails.el (working copy)

@ -160,6 +160,8 @

(:model            "app/models/" (lambda (file) (and (not (rails-core:mailer-p file))
(not (rails-core:observer-p file)))))
(:helper           "app/helpers/")

+ (:unit-test “vendor/plugins/./test/”) ; needs to appear before more-general :plugin

+ (:model “vendor/plugins/./lib/”) ; needs to appear before more-general :plugin

(:plugin           "vendor/plugins/")
(:unit-test        "test/unit/")
(:functional-test  "test/functional/")

@ -207,7 +209,7 @

(kill-region (point-min) (point-max))
(message (concat "Please wait..."))
(call-process rails-ri-command nil "ri" t item)

- (local-set-key [return] ‘rails-search-doc)

+; (local-set-key [return] ‘rails-search-doc) ; because this kicks in in text files. why? -mike

(ansi-color-apply-on-region (point-min) (point-max))
(setq buffer-read-only t)
(goto-char (point-min))))))

@ -394,7 +396,7 @

(lambda()
(require 'rails-ruby)
(require 'ruby-electric)

- (ruby-electric-mode t)

+ (ruby-electric-mode 0)

(ruby-hs-minor-mode t)
(imenu-add-to-menubar "IMENU")
(modify-syntax-entry ?! "w" (syntax-table))