Skip to content

Commit

Permalink
Simplifying the hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
outworlder committed Sep 14, 2011
1 parent 9475dcc commit cc66219
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions children/ruby.el
Expand Up @@ -80,13 +80,6 @@
(define-key yaml-mode-map "\C-m" 'newline-and-indent)))


;;(add-hook 'ruby-mode-hook 'turn-on-font-lock)
(add-hook 'ruby-mode-hook
(lambda ()
(define-key ruby-mode-map "\C-m" 'newline-and-indent)))
;(require 'ruby-electric)
;(ruby-electric-mode t)))

;; TODO: Only check this for .rb files.
;; Warns if we are saving a file with a debugger statement
(defun check-ruby-debugger-statement ()
Expand Down Expand Up @@ -204,30 +197,21 @@
(let ((skeleton-end-newline nil))
(skeleton-insert '(nil " => "))))

(add-hook 'ruby-mode-hook
(lambda ()
(local-set-key "#" 'ruby-insert-hash-string)))

(add-hook 'ruby-mode-hook
(lambda()
(inf-ruby-keys)) t)

(rvm-use-default)

(add-hook 'ruby-mode-hook
(lambda ()
(define-key ruby-mode-map "\C-m" 'newline-and-indent)
(inf-ruby-keys)
(local-set-key "#" 'ruby-insert-hash-string)
(rvm-activate-corresponding-ruby)
(local-set-key [f1] 'ri)
(local-set-key "\M-\C-i" 'ri-ruby-complete-symbol)
(local-set-key [f4] 'ri-ruby-show-args)
(local-set-key (read-kbd-macro "C-'") 'ruby-insert-=>)
;; Don't want flymake mode for ruby regions in rhtml files and also on read only files
(if (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
(flymake-mode t))) t)

(add-hook 'ruby-mode-hook (lambda ()
(local-set-key [f1] 'ri)
(local-set-key "\M-\C-i" 'ri-ruby-complete-symbol)
(local-set-key [f4] 'ri-ruby-show-args)
(local-set-key (read-kbd-macro "C-'") 'ruby-insert-=>)) t)

(add-hook 'ruby-mode-hook
(lambda ()
(rvm-activate-corresponding-ruby)))

(add-hook 'after-save-hook 'check-ruby-debugger-statement)
(add-hook 'ruby-mode-hook 'check-ruby-debugger-statement)

0 comments on commit cc66219

Please sign in to comment.