Subject: [gmane.emacs.devel] random 1 second delay in comint-redirect-results-list-from-process

From: Leo Liu <[email-masked]>
Date: Fri, 21 Jun 2013 09:07:29 +0800

Subject: Topics

Topics:
   random 1 second delay in comint-redirect-results-list-from-process
   Re: random 1 second delay in comint-redirect-results-list-from-process
   Re: random 1 second delay in comint-redirect-results-list-from-process
   Re: random 1 second delay in comint-redirect-results-list-from-process

Subject: random 1 second delay in comint-redirect-results-list-from-process
From: Leo Liu <[email-masked]>
To: [email-masked]
Date: Thu, 20 Jun 2013 08:06:26 +0800

Hi there,

I am seeing seemingly random delay of 1 second when using
comint-redirect-results-list-from-process, which may be the fault of
(accept-process-output nil 1).

Could someone explain (accept-process-output nil 1)? Any harm in
reducing it to (accept-process-output nil)?

Leo

Subject: Re: random 1 second delay in comint-redirect-results-list-from-process
From: Stefan Monnier <[email-masked]>
To: Leo Liu <[email-masked]>
Cc: [email-masked]
Date: Wed, 19 Jun 2013 22:16:12 -0400

> Could someone explain (accept-process-output nil 1)? Any harm in
> reducing it to (accept-process-output nil)?

Rather than nil it should pass the actual process.

        Stefan

Subject: Re: random 1 second delay in comint-redirect-results-list-from-process
From: Leo Liu <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked]
Date: Thu, 20 Jun 2013 16:04:54 +0800

On 2013-06-20 10:16 +0800, Stefan Monnier wrote:
> Rather than nil it should pass the actual process.

Is it OK to apply the following patch?

=== modified file 'lisp/comint.el'
--- lisp/comint.el      2013-05-25 02:40:33 +0000
+++ lisp/comint.el      2013-06-20 05:14:25 +0000
@@ -3726,7 +3726,7 @@
       ;; Wait for the process to complete
       (set-buffer (process-buffer process))
       (while (null comint-redirect-completed)
-       (accept-process-output nil 1))
+       (accept-process-output process))
       ;; Collect the output
       (set-buffer output-buffer)
       (goto-char (point-min))

Subject: Re: random 1 second delay in comint-redirect-results-list-from-process
From: Stefan Monnier <[email-masked]>
To: Leo Liu <[email-masked]>
Cc: [email-masked]
Date: Thu, 20 Jun 2013 16:17:14 -0400

>        (while (null comint-redirect-completed)
> -       (accept-process-output nil 1))
> +       (accept-process-output process))

I think it's OK, tho I think the loop should of course check the return
value of accept-process-output (or else, check that the process is
still running).

        Stefan