[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby 98fac55a80 049/265: Define inf-ruby-switch-from-c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby 98fac55a80 049/265: Define inf-ruby-switch-from-compilation |
Date: |
Sat, 9 Jul 2022 21:59:13 -0400 (EDT) |
branch: elpa/inf-ruby
commit 98fac55a8098a8f237f4461ccb4c3404fd6f65f1
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Define inf-ruby-switch-from-compilation
And a setup function to set up bindings
Closes pezra/rspec-mode#45
---
inf-ruby.el | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/inf-ruby.el b/inf-ruby.el
index 7b615612b1..639dff3b88 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -15,10 +15,18 @@
;; If you're installing manually, you'll need to:
;; * drop the file somewhere on your load path (perhaps ~/.emacs.d)
;; * Add the following lines to your .emacs file:
+;;
;; (autoload 'inf-ruby "inf-ruby" "Run an inferior Ruby process" t)
;; (autoload 'inf-ruby-setup-keybindings "inf-ruby" "" t)
;; (eval-after-load 'ruby-mode
;; '(add-hook 'ruby-mode-hook 'inf-ruby-setup-keybindings))
+;;
+;; Additionally, consider adding
+;;
+;; (inf-ruby-switch-setup)
+;;
+;; to your init file to easily switch from common Ruby compilation
+;; modes to interact with a debugger.
(require 'comint)
(require 'compile)
@@ -391,6 +399,25 @@ Module used by readline when running irb through a
terminal"
(call-interactively 'indent-for-tab-command)
(inf-ruby-complete command)))
+(defun inf-ruby-switch-from-compilation ()
+ "Make the buffer writable and switch to `inf-ruby-mode'.
+Recommended for use when the program being executed enters
+interactive mode, i.e. hits a debugger breakpoint."
+ (interactive)
+ (setq buffer-read-only nil)
+ (inf-ruby-mode))
+
+;;;###autoload
+(defun inf-ruby-switch-setup ()
+ "Modify `rspec-compilation-mode' and `ruby-compilation-mode'
+keymaps to bind `inf-ruby-switch-from-compilation' to `ะก-x C-q'."
+ (eval-after-load 'rspec-mode
+ '(define-key rspec-compilation-mode-map (kbd "C-x C-q")
+ 'inf-ruby-switch-from-compilation))
+ (eval-after-load 'ruby-compilation
+ '(define-key ruby-compilation-mode-map (kbd "C-x C-q")
+ 'inf-ruby-switch-from-compilation)))
+
;;;###autoload (inf-ruby-setup-keybindings)
(provide 'inf-ruby)
- [nongnu] elpa/inf-ruby fe0547b16d 032/265: [Refactor] Use 'kbd' macro for key bindings, (continued)
- [nongnu] elpa/inf-ruby fe0547b16d 032/265: [Refactor] Use 'kbd' macro for key bindings, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 60f9cfa181 001/265: Initial revision., ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c63972e2de 014/265: Package header: Don't require ruby-mode., ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 5fa2849dd0 028/265: Store non-whitespace input in the REPL history, regardless of character length., ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 89147d2ab1 056/265: inf-ruby-completions: Get rid of the last semicolon, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c08bb93df2 040/265: inf-ruby-load-file is not defined, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 90762203f3 055/265: inf-ruby-switch-from-compilation: Change the process filter, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 4873a66a4d 054/265: inf-ruby-completions: Use 'then' instead of semicolons, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 7fc1e32ae7 050/265: Bump the version, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 530ac4f2fc 036/265: inf-ruby-mode: Modify the docstring, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 98fac55a80 049/265: Define inf-ruby-switch-from-compilation,
ELPA Syncer <=
- [nongnu] elpa/inf-ruby fc1dffaeed 052/265: inf-ruby-prompt-format: Include debugger prompt, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby ebceb38165 058/265: inf-ruby-prompt-format: Fix not to match single operator chars, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c749e54eee 063/265: Support Bond completion, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby b12e05a6bb 068/265: Add funtion switching to compilation mode., ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 8fe1c3d80a 061/265: Bump the version, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby a6daf44f67 067/265: Changed 'bundle exec irb' to 'bundle console', ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby b767d52caf 066/265: inf-ruby-console-gem: Pass -r arguments in the bundle exec case, too, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby d18e63e44e 102/265: Not real need for the third argument, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 3a68ee2bb1 086/265: Touch up docstrings, change the signatures of inf-ruby-complete[-or-tab], ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 9f0cea55f0 073/265: Extend usage section, ELPA Syncer, 2022/07/09