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

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

[nongnu] elpa/inf-ruby 1dcaa0aad2 3/3: inf-ruby-interact-with-fromcomp:


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 1dcaa0aad2 3/3: inf-ruby-interact-with-fromcomp: New option (#184)
Date: Wed, 8 May 2024 22:00:30 -0400 (EDT)

branch: elpa/inf-ruby
commit 1dcaa0aad2eec23582263f934005140ddf70f52c
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    inf-ruby-interact-with-fromcomp: New option (#184)
---
 inf-ruby.el | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 607227a493..ab47519270 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -135,6 +135,14 @@ over by a previous Ruby process, as long as it was 
launched in
 the same directory and used the same base name."
   :type 'boolean)
 
+(defcustom inf-ruby-interact-with-fromcomp t
+  "When non-nil, commands will use \"from compilation\" buffers.
+It's buffers that switched to `inf-ruby-mode' from a Compilation mode,
+such as `rspec-compilation-mode', either automatically upon seeing a
+\"breakpoint\" or manually. The commands in question will be such
+commands as `ruby-send-last-stmt' or `ruby-switch-to-inf'."
+  :type 'boolean)
+
 (defconst inf-ruby-prompt-format
   (concat
    (mapconcat
@@ -472,7 +480,8 @@ See variable `inf-ruby-buffers'."
                              ;; Prioritize the first visible buffer,
                              ;; e.g. for the case when it's inf-ruby
                              ;; switched from compilation mode.
-                             (inf-ruby-fromcomp-buffer)
+                             (and inf-ruby-interact-with-fromcomp
+                                  (inf-ruby-fromcomp-buffer))
                              (inf-ruby-buffer)
                              inf-ruby-buffer)))
       (error "No current process. See variable inf-ruby-buffers")))
@@ -806,7 +815,10 @@ Optionally provide FILE and LINE metadata to Ruby."
 With argument, positions cursor at end of buffer."
   (interactive "P")
   (let ((buffer (current-buffer))
-        (inf-ruby-buffer* (or (inf-ruby-fromcomp-buffer) (inf-ruby-buffer) 
inf-ruby-buffer)))
+        (inf-ruby-buffer* (or (and inf-ruby-interact-with-fromcomp
+                                   (inf-ruby-fromcomp-buffer))
+                              (inf-ruby-buffer)
+                              inf-ruby-buffer)))
     (if inf-ruby-buffer*
         (progn
           (pop-to-buffer inf-ruby-buffer*)



reply via email to

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