branch: elpa/inf-ruby
commit 68a7ad32fa75db32f980c254d15d89cd1342bf64
Author: Cornelius Mika <[email protected]>
Commit: Cornelius Mika <[email protected]>
Bugfix: Don't stall Emacs when there is no valid completion output.
---
inf-ruby.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index d389bf10de..fddbdccb58 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -329,7 +329,8 @@ Then switch to the process buffer."
(set-process-filter proc (lambda (proc string) (setf kept (concat kept
string))))
(process-send-string proc (format "puts
IRB::InputCompletor::CompletionProc.call('%s').compact\n"
(ruby-escape-single-quoted seed)))
- (while (not (string-match inf-ruby-prompt-pattern kept))
(accept-process-output proc))
+ (while (and (not (string-match inf-ruby-prompt-pattern kept))
+ (accept-process-output proc 2)))
(if (string-match "^[[:alpha:]]+?Error: " kept) (error kept))
(setf completions (cdr (butlast (split-string kept "[\r\n]") 2)))
(set-process-filter proc comint-filt)