emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/inf-ruby 1dd007201a 197/265: Do not overwrite inf-ruby-buf


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 1dd007201a 197/265: Do not overwrite inf-ruby-buffer if it's still live
Date: Sat, 9 Jul 2022 21:59:26 -0400 (EDT)

branch: elpa/inf-ruby
commit 1dd007201a6f1465791edaea7e80e3adbeda5a45
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Do not overwrite inf-ruby-buffer if it's still live
    
    This way, if the first inf-ruby buffer was non-project specific, we
    don't overwrite the variable's value with a project-specific one.
    
    And the Ruby buffers outside of any projects use the first one.
---
 inf-ruby.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 5173c3496b..e5c9c2f5a6 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -217,7 +217,7 @@ The following commands are available:
 \\{inf-ruby-minor-mode-map}"
   :lighter "" :keymap inf-ruby-minor-mode-map)
 
-(defvar inf-ruby-buffer nil "Last used Ruby process buffer.")
+(defvar inf-ruby-buffer nil "The oldest live Ruby process buffer.")
 
 (defvar inf-ruby-buffers nil "List of Ruby process buffers.")
 
@@ -372,7 +372,10 @@ Runs the hooks `comint-mode-hook' and `inf-ruby-mode-hook'.
     (setq inf-ruby-buffer-impl-name name
           inf-ruby-buffer-command command))
 
-  (pop-to-buffer (setq inf-ruby-buffer (current-buffer))))
+  (unless (and inf-ruby-buffer (comint-check-proc inf-ruby-buffer))
+    (setq inf-ruby-buffer (current-buffer)))
+
+  (pop-to-buffer (current-buffer)))
 
 (defun run-ruby-or-pop-to-buffer (command &optional name buffer)
   (if (not (and buffer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]