mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Cleanup robe processes killing last ruby buffer
Experimental?
This commit is contained in:
15
modules/lang/ruby/autoload.el
Normal file
15
modules/lang/ruby/autoload.el
Normal file
@ -0,0 +1,15 @@
|
||||
;;; lang/ruby/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +ruby|cleanup-robe-servers ()
|
||||
"Clean up dangling inf robe processes if there are no more `enh-ruby-mode'
|
||||
buffers open."
|
||||
;; FIXME This should wait X seconds before cleaning up
|
||||
(unless (or (not robe-mode) (doom-buffers-in-mode 'enh-ruby-mode))
|
||||
(let (inf-buffer kill-buffer-query-functions)
|
||||
(while (setq inf-buffer (robe-inf-buffer))
|
||||
(let ((process (get-buffer-process inf-buffer))
|
||||
confirm-kill-processes)
|
||||
(when (processp process)
|
||||
(kill-process (get-buffer-process inf-buffer))
|
||||
(kill-buffer inf-buffer)))))))
|
Reference in New Issue
Block a user