[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby f6a6b89e08 161/265: Adapting code to use looking-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby f6a6b89e08 161/265: Adapting code to use looking-at over re-search-forward. |
Date: |
Sat, 9 Jul 2022 21:59:22 -0400 (EDT) |
branch: elpa/inf-ruby
commit f6a6b89e085419fe1836f7d1938a0b0a96142f45
Author: Daniel Luna <dancluna@gmail.com>
Commit: Daniel Luna <dancluna@gmail.com>
Adapting code to use looking-at over re-search-forward.
Replacing macro by a regular function.
---
inf-ruby.el | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index 472f133840..1492796652 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -634,7 +634,7 @@ keymaps to bind `inf-ruby-switch-from-compilation' to `ะก-x
C-q'."
one of the predicates matches, then calls `inf-ruby-console-NAME',
passing it the found directory.")
-(defvar inf-ruby-breakpoint-pattern "\\(\\[1\\] pry(\\)\\|\\((rdb:1)\\)"
+(defvar inf-ruby-breakpoint-pattern ".*\\(\\[1\\] pry(\\)\\|\\((rdb:1)\\)"
"Pattern found when a breakpoint is triggered in a compilation session.
This checks if the current line is a pry or ruby-debug prompt.")
@@ -735,28 +735,26 @@ Gemfile, it should use the `gemspec' instruction."
(let ((default-directory (file-name-as-directory dir)))
(run-ruby "bundle exec racksh" "racksh")))
-(defmacro in-ruby-compilation-modes (mode-var &rest body)
- "Checks if MODE-VAR is a ruby compilation mode, and runs BODY in an
-implicit progn if t."
- `(when (member ,mode-var '(rspec-compilation-mode
- ruby-compilation-mode
- projectile-rails-server-mode))
- (progn ,@body)))
+(defun inf-ruby-in-ruby-compilation-modes (mode-var)
+ "Checks if MODE-VAR is a ruby compilation mode"
+ (member mode-var '(rspec-compilation-mode
+ ruby-compilation-mode
+ projectile-rails-server-mode)))
(defun inf-ruby-auto-enter ()
"Automatically enters inf-ruby mode when it sees a breakpoint-indicating
pattern."
- (in-ruby-compilation-modes major-mode
- (save-excursion
- (beginning-of-line)
- (when (looking-at inf-ruby-breakpoint-pattern)
- (inf-ruby-switch-from-compilation)))))
+ (when (inf-ruby-in-ruby-compilation-modes major-mode)
+ (save-excursion
+ (beginning-of-line)
+ (when (looking-at inf-ruby-breakpoint-pattern)
+ (inf-ruby-switch-from-compilation)))))
(defun inf-ruby-auto-exit (input)
"Checks if the current input is a debugger exit command and returns
to the previous compilation mode if t."
- (in-ruby-compilation-modes inf-ruby-orig-compilation-mode
- (if (member input '("quit" "exit"))
- (inf-ruby-maybe-switch-to-compilation))))
+ (when (inf-ruby-in-ruby-compilation-modes inf-ruby-orig-compilation-mode)
+ (if (member input '("quit" "exit"))
+ (inf-ruby-maybe-switch-to-compilation))))
(defun inf-ruby-setup-auto-breakpoint ()
(add-hook 'compilation-filter-hook 'inf-ruby-auto-enter)
- [nongnu] elpa/inf-ruby b3747e9574 127/265: Merge pull request #59 from proofit404/master, (continued)
- [nongnu] elpa/inf-ruby b3747e9574 127/265: Merge pull request #59 from proofit404/master, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 9157d9c561 115/265: inf-ruby-console-gem: when gemspec doesn't modify LOAD_PATH, -I lib, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 4da1cca555 079/265: Set process filter in inf-ruby-switch-to-compilation, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby a960434970 096/265: run-ruby: write better docstring, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby dbb8d63324 082/265: Add missing license section to comment front-matter, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 27143433e4 083/265: A few doc fixes, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby d91f395070 080/265: Add missing require for thingatpt, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 4c39cd1509 123/265: Fix a couple of compilation warnings, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 00237986d8 130/265: Turn `inf-ruby-implementations` into custom form, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 70da83f8e4 131/265: Merge pull request #54 from wasamasa/feature-defcustom, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby f6a6b89e08 161/265: Adapting code to use looking-at over re-search-forward.,
ELPA Syncer <=
- [nongnu] elpa/inf-ruby 505a7bc140 170/265: Merge pull request #84 from janpath/patch-1, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 4d82095424 174/265: inf-ruby-console-gem: Only try to load Ruby files, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 4f6a265640 178/265: Add support for zeus console, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby af4f238ef4 200/265: Merge pull request #99 from dgopstein/master, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 4893dd6426 208/265: Describe how to add custom prompt patterns (#108), ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 49d59a7897 216/265: Merge pull request #115 from p-sdk/add-ruby-send-and-go-commands, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby a4c766e605 231/265: Use pry_instance, _pry_ is not in Pry 0.13 anymore, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 9f0f79ff45 232/265: inf-ruby-console-rails: Try to handle IRB's "multiline" thing here, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c2a28ef6a1 242/265: Replace toggle-read-only-mode with read-only-mode, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby cd50ce8432 249/265: Creating eval overlay feature, ELPA Syncer, 2022/07/09