Cleanup robe processes killing last ruby buffer

Experimental?
This commit is contained in:
Henrik Lissner 2018-07-06 23:11:26 +02:00
parent f5f87ee0a3
commit 00d6e7b9ca
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 19 additions and 3 deletions

View file

@ -78,9 +78,10 @@ environment variables."
;; robe-start errors if you hit no.
(defun +ruby|init-robe ()
(when (executable-find "ruby")
(cl-letf (((symbol-function #'yes-or-no-p)
(lambda (&rest _) t)))
(ignore-errors (robe-start)))))
(cl-letf (((symbol-function #'yes-or-no-p) (lambda (_) t)))
(ignore-errors (robe-start))
(when (robe-running-p)
(add-hook 'kill-buffer-hook #'+ruby|cleanup-robe-servers nil t)))))
(add-hook 'enh-ruby-mode-hook #'+ruby|init-robe)
:config
(set-company-backend! 'robe-mode 'company-robe))