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

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

[nongnu] elpa/inf-ruby d308394e7a 041/265: inf-ruby-output-filter: Ignor


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby d308394e7a 041/265: inf-ruby-output-filter: Ignore empty strings
Date: Sat, 9 Jul 2022 21:59:12 -0400 (EDT)

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

    inf-ruby-output-filter: Ignore empty strings
    
    * They happen with comint-process-echoes t.
    * Only modify the local comint-output-filter-functions value.
---
 inf-ruby.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 215d24e085..018fcdeb22 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -144,7 +144,7 @@ to continue it."
   (setq mode-name "Inf-Ruby")
   (setq mode-line-process '(":%s"))
   (use-local-map inf-ruby-mode-map)
-  (add-to-list 'comint-output-filter-functions 'inf-ruby-output-filter)
+  (add-hook 'comint-output-filter-functions 'inf-ruby-output-filter nil t)
   (setq comint-get-old-input (function inf-ruby-get-old-input))
   (make-local-variable 'compilation-error-regexp-alist)
   (setq compilation-error-regexp-alist inf-ruby-error-regexp-alist)
@@ -153,9 +153,10 @@ to continue it."
 
 (defun inf-ruby-output-filter (output)
   "Check if the current prompt is a top-level prompt"
-  (setq inf-ruby-at-top-level-prompt-p
-        (string-match inf-ruby-first-prompt-pattern
-                      (car (last (split-string output "\n"))))))
+  (unless (zerop (length output))
+    (setq inf-ruby-at-top-level-prompt-p
+          (string-match inf-ruby-first-prompt-pattern
+                        (car (last (split-string output "\n")))))))
 
 ;; adapted from replace-in-string in XEmacs (subr.el)
 (defun inf-ruby-remove-in-string (str regexp)



reply via email to

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