[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby 1a5aebea0d 213/265: Bring back interactive run-ru
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby 1a5aebea0d 213/265: Bring back interactive run-ruby |
Date: |
Sat, 9 Jul 2022 21:59:27 -0400 (EDT) |
branch: elpa/inf-ruby
commit 1a5aebea0d701aaeae3158e6a1d5407d7d341ff1
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Bring back interactive run-ruby
Closes #112
---
inf-ruby.el | 34 ++++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index 920254ac0c..7a77732558 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -338,22 +338,40 @@ to that buffer. Otherwise create a new buffer."
(setq impl (or impl "ruby"))
(let ((command (cdr (assoc impl inf-ruby-implementations))))
- (run-ruby-or-pop-to-buffer command impl
- (or (inf-ruby-buffer)
- inf-ruby-buffer))))
+ (run-ruby command impl)))
;;;###autoload
-(defun run-ruby (command &optional name)
- "Run an inferior Ruby process, input and output in a new buffer.
+(defun run-ruby (&optional command name)
+ "Run an inferior Ruby process, input and output in a buffer.
+
+If there is a process already running in a corresponding buffer,
+switch to that buffer. Otherwise create a new buffer.
The consecutive buffer names will be:
`*NAME*', `*NAME*<2>', `*NAME*<3>' and so on.
-NAME defaults to \"ruby\".
+COMMAND defaults to the default entry in
+`inf-ruby-implementations'. NAME defaults to \"ruby\".
Runs the hooks `comint-mode-hook' and `inf-ruby-mode-hook'.
-\(Type \\[describe-mode] in the process buffer for the list of commands.)"
+Type \\[describe-mode] in the process buffer for the list of commands."
+ ;; This function is interactive and named like this for consistency
+ ;; with `run-python', `run-octave', `run-lisp' and so on.
+ ;; We're keeping both it and `inf-ruby' for backward compatibility.
+ (interactive)
+ (run-ruby-or-pop-to-buffer
+ (or command (cdr (assoc inf-ruby-default-implementation
+ inf-ruby-implementations)))
+ (or name "ruby")
+ (or (inf-ruby-buffer)
+ inf-ruby-buffer)))
+
+(defun run-ruby-new (command &optional name)
+ "Create a new inferior Ruby process in a new buffer.
+
+COMMAND is the command to call. NAME will be used for the name of
+the buffer, defaults to \"ruby\"."
(setq name (or name "ruby"))
(let ((commandlist (split-string-and-unquote command))
@@ -380,7 +398,7 @@ Runs the hooks `comint-mode-hook' and `inf-ruby-mode-hook'.
(defun run-ruby-or-pop-to-buffer (command &optional name buffer)
(if (not (and buffer
(comint-check-proc buffer)))
- (run-ruby command name)
+ (run-ruby-new command name)
(pop-to-buffer buffer)
(unless (and (string= inf-ruby-buffer-impl-name name)
(string= inf-ruby-buffer-command command))
- [nongnu] elpa/inf-ruby 1940f90fde 017/265: Version 2.2.3, (continued)
- [nongnu] elpa/inf-ruby 1940f90fde 017/265: Version 2.2.3, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby b45b057006 044/265: Fix syntax error highlighting, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby a85ae010c6 046/265: Handle different prompts, not just the IRB default, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 310da805b6 129/265: Bump the version, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 67629312ad 120/265: Work around pry/pry#1267, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 866483eecc 190/265: Fix a comment, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c45cd825e0 195/265: inf-ruby-mode: Use define-derived-mode, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby bf380c13e5 198/265: Support JRuby 9000 RVM prompt, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby a4b1c40202 204/265: inf-ruby-console-script: Extract from ...-default, and up its priority, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 674a2a837f 209/265: Drop a newline and link to the wiki page directly, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 1a5aebea0d 213/265: Bring back interactive run-ruby,
ELPA Syncer <=
- [nongnu] elpa/inf-ruby fe1ea9925c 226/265: Restore original compilation-error-regexp-alist, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 9bfbce42be 241/265: Untabify and reformat the new code a little, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 92d5d122fa 245/265: Use 'bundle exec' in nomultiline check when needed, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby bcdb97983c 257/265: Merge pull request #154 from tunnes/feature-create-load-current-ruby-file, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 5143c84f91 189/265: inf-ruby-proc: Fall back to inf-ruby-buffer, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 5b24985b0e 135/265: Check IRB is defined before using it, fixes #64, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby f908b1f506 136/265: Merge pull request #65 from iqbalansari/master, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 0af69257a4 138/265: Clarify the "usage" section, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 12d1d35f73 153/265: Add ruby-send-buffer function, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby d39ea0bd59 212/265: Use a more common idea of prefix, ELPA Syncer, 2022/07/09