[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby a85ae010c6 046/265: Handle different prompts, no
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby a85ae010c6 046/265: Handle different prompts, not just the IRB default |
Date: |
Sat, 9 Jul 2022 21:59:12 -0400 (EDT) |
branch: elpa/inf-ruby
commit a85ae010c678efab205edcff4858f65938b7fc43
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Handle different prompts, not just the IRB default
* The regexp is adapted from Rinari.
* Fixes #6.
---
inf-ruby.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index 6bd299d95f..612bb04b6e 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -27,10 +27,24 @@
(defvar inf-ruby-default-implementation "ruby"
"Which Ruby implementation to use if none is specified.")
-(defvar inf-ruby-first-prompt-pattern "^irb(.*)[0-9:]+0> *"
+(defconst inf-ruby-prompt-format
+ (mapconcat
+ #'identity
+ '("\\(^%s> .*\\)" ; Simple
+ "\\(^\\(irb([^)]+)" ; IRB default
+ "\\(\[[0-9]+\] \\)?[Pp]ry ?([^)]+)" ; Pry
+ "\\(jruby-\\|JRUBY-\\)?[1-9]\\.[0-9]\\.[0-9]+\\(-?p?[0-9]+\\)?" ; RVM
+ ;; Statement and nesting counters, common to the last three.
+ "\\) ?[0-9:]* ?%s *\\)")
+ "\\|")
+ "Format string for the prompt regexp pattern.
+Two placeholders: first char in the Simple prompt, and the last
+graphical char in all other prompts.")
+
+(defvar inf-ruby-first-prompt-pattern (format inf-ruby-prompt-format ">" ">")
"First prompt regex pattern of Ruby interpreter.")
-(defvar inf-ruby-prompt-pattern "^\\(irb(.*)[0-9:]+[>*\"'] *\\)+"
+(defvar inf-ruby-prompt-pattern (format inf-ruby-prompt-format "[?>]"
"[\]>*\"'/`]")
"Prompt regex pattern of Ruby interpreter.")
(defvar inf-ruby-mode-hook nil
- [nongnu] elpa/inf-ruby 03e969c89a 146/265: Retain compilation-arguments, (continued)
- [nongnu] elpa/inf-ruby 03e969c89a 146/265: Retain compilation-arguments, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 7f8f32e7d0 154/265: Use 'point-min instead of the hardcoded value, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 45af13a729 172/265: Recognize byebug prompt, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 8b198d01e9 180/265: Merge pull request #93 from sideshowcoder/zeus-console-support, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c14a68d164 207/265: Specify environment correctly, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 5ae6149a15 211/265: Merge pull request #110 from ppiotrowicz/master, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby a986a1a8c6 260/265: Fix broken behaviour on load-current-ruby-file fn, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby dbf4386bac 264/265: Use a more uniform style, ELPA Syncer, 2022/07/09
- [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 <=
- [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, 2022/07/09
- [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