branch: elpa/inf-ruby
commit 6a45c1451a4d4b8f8dac64ea48167ab3b5bc48fa
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>
inf-ruby-switch-to-compilation: Rename to -maybe-, tweak the docstring
and untabify.
---
inf-ruby.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index 360ad1a859..093522562c 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -70,7 +70,7 @@ graphical char in all other prompts.")
(define-key map (kbd "C-c C-l") 'ruby-load-file)
(define-key map (kbd "C-x C-e") 'ruby-send-last-sexp)
(define-key map (kbd "TAB") 'inf-ruby-complete)
- (define-key map (kbd "C-x C-q") 'inf-ruby-switch-to-compilation)
+ (define-key map (kbd "C-x C-q") 'inf-ruby-maybe-switch-to-compilation)
map)
"Mode map for inf-ruby-mode")
@@ -457,13 +457,15 @@ interactive mode, i.e. hits a debugger breakpoint."
(delete-region (match-beginning 0) (point))
(comint-output-filter proc line)))))
-(defun inf-ruby-switch-to-compilation ()
- "Switch to compilation mode before switching to `inf-ruby-mode'."
+(defun inf-ruby-maybe-switch-to-compilation ()
+ "Switch to compilation mode this buffer was in before
+`inf-ruby-switch-from-compilation' was called, if it was.
+Otherwise, just toggle read-only status."
(interactive)
(if inf-ruby-orig-compilation-mode
(let ((orig-mode-line-process mode-line-process))
- (funcall inf-ruby-orig-compilation-mode)
- (setq mode-line-process orig-mode-line-process))
+ (funcall inf-ruby-orig-compilation-mode)
+ (setq mode-line-process orig-mode-line-process))
(toggle-read-only)))
;;;###autoload