From 80d52851edacb78787fcbbbf5460fa0695259e13 Mon Sep 17 00:00:00 2001 From: Maxim Kashchenko Date: Mon, 25 Apr 2016 08:26:36 +0700 Subject: [PATCH 1/3] Make code similar within inf-ruby-switch-from-compilation --- inf-ruby.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inf-ruby.el b/inf-ruby.el index 8d4db9c..540a439 100755 --- a/inf-ruby.el +++ b/inf-ruby.el @@ -585,8 +585,7 @@ interactive mode, i.e. hits a debugger breakpoint." (let ((mode major-mode) (arguments compilation-arguments)) (inf-ruby-mode) - (make-local-variable 'inf-ruby-orig-compilation-mode) - (setq inf-ruby-orig-compilation-mode mode) + (set (make-local-variable 'inf-ruby-orig-compilation-mode) mode) (set (make-local-variable 'compilation-arguments) arguments)) (let ((proc (get-buffer-process (current-buffer)))) (when proc From 3218186f43effcba63fd914258bba2c4fb5c43ef Mon Sep 17 00:00:00 2001 From: Maxim Kashchenko Date: Mon, 25 Apr 2016 09:17:01 +0700 Subject: [PATCH 2/3] Jump to end of buffer when switch from compilation --- inf-ruby.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inf-ruby.el b/inf-ruby.el index 540a439..eda834a 100755 --- a/inf-ruby.el +++ b/inf-ruby.el @@ -99,6 +99,13 @@ Also see the description of `ielm-prompt-read-only'." inf-ruby-implementations)) :group 'inf-ruby) +(defcustom inf-ruby-jump-to-end-of-buffer nil + "If non-nil, `inf-ruby-switch-from-compilation' will jump to end of buffer. + +In this way the point will be in the prompt." + :type 'boolean + :group 'inf-ruby) + (defconst inf-ruby-prompt-format (concat (mapconcat @@ -582,6 +589,8 @@ interactive mode, i.e. hits a debugger breakpoint." (interactive) (setq buffer-read-only nil) (buffer-enable-undo) + (when inf-ruby-jump-to-end-of-buffer + (goto-char (point-max))) (let ((mode major-mode) (arguments compilation-arguments)) (inf-ruby-mode) From 0b089d1d2a108de068e4457f4caf259b7f627caa Mon Sep 17 00:00:00 2001 From: Maxim Kashchenko Date: Tue, 26 Apr 2016 10:19:28 +0700 Subject: [PATCH 3/3] Make code similar within inf-ruby-switch-from-compilation https://github.com/nonsequitur/inf-ruby/pull/87#discussion_r61004401 --- inf-ruby.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inf-ruby.el b/inf-ruby.el index eda834a..d0b0eda 100755 --- a/inf-ruby.el +++ b/inf-ruby.el @@ -598,8 +598,7 @@ interactive mode, i.e. hits a debugger breakpoint." (set (make-local-variable 'compilation-arguments) arguments)) (let ((proc (get-buffer-process (current-buffer)))) (when proc - (make-local-variable 'inf-ruby-orig-process-filter) - (setq inf-ruby-orig-process-filter (process-filter proc)) + (set (make-local-variable 'inf-ruby-orig-process-filter) (process-filter proc)) (set-process-filter proc 'comint-output-filter)) (when (looking-back inf-ruby-prompt-pattern (line-beginning-position)) (let ((line (match-string 0)))