emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/inf-ruby 3940b91ac5 252/265: Create load current ruby file


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 3940b91ac5 252/265: Create load current ruby file fn and key binding
Date: Sat, 9 Jul 2022 21:59:30 -0400 (EDT)

branch: elpa/inf-ruby
commit 3940b91ac57153a488294291ecf8bddd5cdadee5
Author: tunnes <ayrton.tunes@outlook.com>
Commit: tunnes <ayrton.tunes@outlook.com>

    Create load current ruby file fn and key binding
    
    Currently we already have the load ruby file feature, but it needs to 
provide a
    file that must be loaded on the inferior Ruby process, but usually we might 
want
    to load the file that we are changing on the current buffer, this change 
aims to
    adderess that.
---
 inf-ruby.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/inf-ruby.el b/inf-ruby.el
index b35f7d9495..24f09191c0 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -165,6 +165,7 @@ graphical char in all other prompts.")
 (defvar inf-ruby-mode-map
   (let ((map (copy-keymap comint-mode-map)))
     (define-key map (kbd "C-c C-l") 'ruby-load-file)
+    (define-key map (kbd "C-c C-k") 'ruby-load-current-file)
     (define-key map (kbd "C-x C-e") 'ruby-send-last-stmt)
     (define-key map (kbd "TAB") 'completion-at-point)
     (define-key map (kbd "C-x C-q") 'inf-ruby-maybe-switch-to-compilation)
@@ -215,6 +216,7 @@ next one.")
     (define-key map (kbd "C-c M-r") 'ruby-send-region-and-go)
     (define-key map (kbd "C-c C-z") 'ruby-switch-to-inf)
     (define-key map (kbd "C-c C-l") 'ruby-load-file)
+    (define-key map (kbd "C-c C-k") 'ruby-load-current-file)
     (define-key map (kbd "C-c C-s") 'inf-ruby)
     (easy-menu-define
       inf-ruby-minor-mode-menu
@@ -652,6 +654,11 @@ Then switch to the process buffer."
                                               file-name
                                               "\"\)\n")))
 
+(defun ruby-load-current-file ()
+  "Load the current ruby file into the inferior Ruby process."
+  (interactive)
+  (ruby-load-file (buffer-name)))
+
 (defun ruby-send-buffer ()
   "Send the current buffer to the inferior Ruby process."
   (interactive)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]