[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby f8d7404ea9 5/6: use double quoted strings to be a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby f8d7404ea9 5/6: use double quoted strings to be able to use \n |
Date: |
Thu, 28 Sep 2023 13:01:33 -0400 (EDT) |
branch: elpa/inf-ruby
commit f8d7404ea95c703fa340eac2f44e268a24905687
Author: bo-tato <122528427+bo-tato@users.noreply.github.com>
Commit: bo-tato <122528427+bo-tato@users.noreply.github.com>
use double quoted strings to be able to use \n
---
inf-ruby.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index 4754c1e493..91fccd173a 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -676,12 +676,13 @@ This function also removes itself from
`pre-command-hook'."
(buffer-substring-no-properties (point) (line-end-position))))))
(defun ruby-shell--encode-string (string)
- "Escape all backslashes, single quotes, and newlines in STRING."
+ "Escape all backslashes, double quotes, newlines, and # in STRING."
(cl-reduce (lambda (string subst)
(replace-regexp-in-string (car subst) (cdr subst) string))
'(("\\\\" . "\\\\\\\\")
- ("'" . "\\\\'")
- ("\n" . "'\"\\\\n\"'"))
+ ("\"" . "\\\\\"")
+ ("#" . "\\\\#")
+ ("\n" . "\\\\n"))
:initial-value string))
(defun ruby-send-string (string &optional file line)
@@ -693,7 +694,7 @@ Optionally provide FILE and LINE metadata to Ruby."
(format ", %S" (inf-ruby-file-local-name
file)))
(when (and file line)
(format ", %d" line))))
- (code (format "eval('%s', %s%s)\n"
+ (code (format "eval(\"%s\", %s%s)\n"
(ruby-shell--encode-string string)
inf-ruby-eval-binding
file-and-lineno)))
- [nongnu] elpa/inf-ruby updated (4714f02bd8 -> 74c8be8e27), ELPA Syncer, 2023/09/28
- [nongnu] elpa/inf-ruby a4b4e390af 2/6: fix for tramp mode, ELPA Syncer, 2023/09/28
- [nongnu] elpa/inf-ruby 6a2d3c9c28 3/6: properly clean up temp file over tramp, ELPA Syncer, 2023/09/28
- [nongnu] elpa/inf-ruby 66809aba93 4/6: simplify getting tempdir, doc and fix format arg, ELPA Syncer, 2023/09/28
- [nongnu] elpa/inf-ruby 74c8be8e27 6/6: Merge pull request #175 from bo-tato/prompt-and-long-line-fix, ELPA Syncer, 2023/09/28
- [nongnu] elpa/inf-ruby 27fac14911 1/6: fix for duplicate prompt and long lines, ELPA Syncer, 2023/09/28
- [nongnu] elpa/inf-ruby f8d7404ea9 5/6: use double quoted strings to be able to use \n,
ELPA Syncer <=