Skip to content

Commit

Permalink
ruby-send-string: Use simply "binding" for eval when the process is c…
Browse files Browse the repository at this point in the history
…ompilation

Resolves #184
  • Loading branch information
dgutov committed Jun 5, 2024
1 parent 1dcaa0a commit 0cfe8b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion inf-ruby.el
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,17 @@ Optionally provide FILE and LINE metadata to Ruby."
(format ", %S" (file-local-name file)))
(when (and file line)
(format ", %d" line))))
(proc (inf-ruby-proc))
(inf-ruby-eval-binding (if (buffer-local-value
'inf-ruby-orig-compilation-mode
(process-buffer proc))
"binding"
inf-ruby-eval-binding))
(code (format "eval(\"%s\", %s%s)\n"
(ruby-shell--encode-string string)
inf-ruby-eval-binding
file-and-lineno)))
(if (or (null (process-tty-name (inf-ruby-proc)))
(if (or (null (process-tty-name proc))
(<= (string-bytes code)
(or (bound-and-true-p comint-max-line-length)
1024))) ;; For Emacs < 28
Expand Down

0 comments on commit 0cfe8b2

Please sign in to comment.