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

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

[nongnu] elpa/inf-ruby ed768ce413 004/265: Evaluate code sent via 'ruby-


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby ed768ce413 004/265: Evaluate code sent via 'ruby-send-region' in the same binding as the REPL.
Date: Sat, 9 Jul 2022 21:59:09 -0400 (EDT)

branch: elpa/inf-ruby
commit ed768ce4138a79780f16975e65c65ce80737303e
Author: Cornelius Mika <cornelius.mika@gmail.com>
Commit: Cornelius Mika <cornelius.mika@gmail.com>

    Evaluate code sent via 'ruby-send-region' in the same binding as the REPL.
    This allows for consistent access to REPL-local variables.
---
 inf-ruby.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 6a639cdf00..fff3c6c716 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -219,6 +219,8 @@ of `ruby-program-name').  Runs the hooks 
`inferior-ruby-mode-hook'
   "Template for irb here document terminator.
 Must not contain ruby meta characters.")
 
+(defconst inf-ruby-eval-binding "IRB.conf[:MAIN_CONTEXT].workspace.binding")
+
 (defconst ruby-eval-separator "")
 
 (defun ruby-send-region (start end)
@@ -241,7 +243,9 @@ Must not contain ruby meta characters.")
         (goto-char m)
         (insert ruby-eval-separator "\n")
         (set-marker m (point))))
-    (comint-send-string (inf-ruby-proc) (format "eval <<'%s', nil, %S, %d\n" 
term file line))
+    (comint-send-string (inf-ruby-proc) (format "eval <<'%s', %s, %S, %d\n"
+                                                term inf-ruby-eval-binding
+                                                file line))
     (comint-send-region (inf-ruby-proc) start end)
     (comint-send-string (inf-ruby-proc) (concat "\n" term "\n"))))
 



reply via email to

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