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

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

[nongnu] elpa/inf-ruby 928a5dfd73 059/265: inf-ruby-switch-from-compilat


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 928a5dfd73 059/265: inf-ruby-switch-from-compilation: Call `comint-output-filter` on current line
Date: Sat, 9 Jul 2022 21:59:14 -0400 (EDT)

branch: elpa/inf-ruby
commit 928a5dfd73e26abf4eda6ec20ec597aee8a8e130
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    inf-ruby-switch-from-compilation: Call `comint-output-filter` on current 
line
    
    This colors the prompt and sets inf-ruby-at-top-level-prompt-p.
---
 inf-ruby.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 573b711dff..55ae02134b 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -416,8 +416,13 @@ interactive mode, i.e. hits a debugger breakpoint."
   (interactive)
   (setq buffer-read-only nil)
   (buffer-enable-undo)
-  (set-process-filter (get-buffer-process (current-buffer)) 
'comint-output-filter)
-  (inf-ruby-mode))
+  (inf-ruby-mode)
+  (let ((proc (get-buffer-process (current-buffer))))
+    (set-process-filter proc 'comint-output-filter)
+    (when (looking-back inf-ruby-prompt-pattern (line-beginning-position))
+      (let ((line (match-string 0)))
+        (delete-region (match-beginning 0) (point))
+        (comint-output-filter proc line)))))
 
 ;;;###autoload
 (defun inf-ruby-switch-setup ()



reply via email to

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