Automatically switch from RSpec compilation mode to interact with a debugger

This commit adds the 'inf-ruby-auto-enter method to
'compilation-filter-hook, automatically entering inf-ruby-mode when it
hits a breakpoint (see the
[inf-ruby-manual](https://github.com/nonsequitur/inf-ruby/#manual) for
more details).

The hook is added locally to the rspec-compilation-mode-hook to avoid
global slowdown, as the compilation-filter-hook is called whenever a
new line is entered.
This commit is contained in:
Daniel Luna 2016-05-14 16:57:28 -03:00 committed by syl20bnr
parent 7506024684
commit af3f053235

View file

@ -127,6 +127,10 @@
;; setup the hook via an autoload
:config
(progn
(defun spacemacs//inf-ruby-auto-enter ()
"Automatically enters inf-ruby-mode in ruby modes' debugger breakpoints."
(add-hook 'compilation-filter-hook 'inf-ruby-auto-enter nil t))
(add-hook 'rspec-compilation-mode-hook 'spacemacs//inf-ruby-auto-enter)
(spacemacs|hide-lighter rspec-mode)
(dolist (mode '(ruby-mode enh-ruby-mode))
(spacemacs/set-leader-keys-for-major-mode mode