branch: elpa/inf-ruby
commit 49d59a7897f594e3be74ecbddae83719f9a6c0f0
Merge: 57710da5c8 c2bb2f7186
Author: Dmitry Gutov <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #115 from p-sdk/add-ruby-send-and-go-commands
Add ruby-send-{buffer,line}-and-go commands
---
inf-ruby.el | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/inf-ruby.el b/inf-ruby.el
index 25607b0d9f..988330801b 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -571,6 +571,13 @@ Then switch to the process buffer."
(widen)
(ruby-send-region (point-min) (point-max))))
+(defun ruby-send-buffer-and-go ()
+ "Send the current buffer to the inferior Ruby process.
+Then switch to the process buffer."
+ (interactive)
+ (ruby-send-buffer)
+ (ruby-switch-to-inf t))
+
(defun ruby-send-line ()
"Send the current line to the inferior Ruby process."
(interactive)
@@ -578,6 +585,13 @@ Then switch to the process buffer."
(widen)
(ruby-send-region (point-at-bol) (point-at-eol))))
+(defun ruby-send-line-and-go ()
+ "Send the current line to the inferior Ruby process.
+Then switch to the process buffer."
+ (interactive)
+ (ruby-send-line)
+ (ruby-switch-to-inf t))
+
(defun ruby-escape-single-quoted (str)
"Escape single quotes, double quotes and newlines in STR."
(replace-regexp-in-string "'" "\\\\'"