Adjust ruby mode
authorJoerg Jaspert <joerg@debian.org>
Fri, 23 May 2014 08:36:25 +0000 (10:36 +0200)
committerJoerg Jaspert <joerg@debian.org>
Fri, 23 May 2014 08:36:25 +0000 (10:36 +0200)
.emacs.d/config/emacs.org

index 21e2711..3e6e6b9 100644 (file)
@@ -3298,19 +3298,19 @@ Programming in ruby...
     (use-package ruby-hash-syntax
       :ensure ruby-hash-syntax)
 
-    (defun my-ruby-mode-hook ()
-      (require 'inf-ruby)
-      (inf-ruby-keys)
-
-      (bind-key "<return>" 'my-ruby-smart-return ruby-mode-map)
-      ;(bind-key "<tab>" 'indent-for-tab-command ruby-mode-map)
-
+    (use-package inf-ruby
+      :ensure inf-ruby
+      :commands inf-ruby-minor-mode
+      :init
+      (progn
+        (add-hook 'ruby-mode-hook 'inf-ruby-minor-mode)
+        (bind-key "<return>" 'my-ruby-smart-return ruby-mode-map)
+        ;(bind-key "<tab>" 'indent-for-tab-command ruby-mode-map)
 
-      (set (make-local-variable 'yas-fallback-behavior)
-           '(apply ruby-indent-command . nil))
-      (bind-key "<tab>" 'yas-expand-from-trigger-key ruby-mode-map))
 
-    (add-hook 'ruby-mode-hook 'my-ruby-mode-hook)
+        (set (make-local-variable 'yas-fallback-behavior)
+             '(apply ruby-indent-command . nil))
+        (bind-key "<tab>" 'yas-expand-from-trigger-key ruby-mode-map)))
 
     ;; Stupidly the non-bundled ruby-mode isn't a derived mode of
     ;; prog-mode: we run the latter's hooks anyway in that case.