From d3c2753a571688370a4bc8fa2254679d9c23b74a Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Thu, 27 Dec 2012 21:46:38 +0100 Subject: [PATCH] Avoid hanging emacs by complex comint input senders. Revert the order of echo-len check and accept-process-output to avoid stalling Emacs when there is no process output left. --- lisp/ChangeLog | 6 ++++++ lisp/comint.el | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5f4853d..cc94b0d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-12-27 Vitalie Spinu + + * comint.el (comint-send-input): revert the order of echo-len + check and accept-process-output to avoid hanging Emacs when there + is no process output left. + 2012-12-27 Michael Albinus * net/tramp.el (tramp-handle-file-accessible-directory-p): New defun. diff --git a/lisp/comint.el b/lisp/comint.el index f3450e3..6477f00 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1847,9 +1847,9 @@ Similarly for Soar, Scheme, etc." (let ((echo-len (- comint-last-input-end comint-last-input-start))) ;; Wait for all input to be echoed: - (while (and (accept-process-output proc) - (> (+ comint-last-input-end echo-len) + (while (and (> (+ comint-last-input-end echo-len) (point-max)) + (accept-process-output proc) (zerop (compare-buffer-substrings nil comint-last-input-start -- 1.7.10.4