all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* random 1 second delay in comint-redirect-results-list-from-process
@ 2013-06-20  0:06 Leo Liu
  2013-06-20  2:16 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Liu @ 2013-06-20  0:06 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: random 1 second delay in comint-redirect-results-list-from-process
  2013-06-20  0:06 random 1 second delay in comint-redirect-results-list-from-process Leo Liu
@ 2013-06-20  2:16 ` Stefan Monnier
  2013-06-20  8:04   ` Leo Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2013-06-20  2:16 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

> 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: random 1 second delay in comint-redirect-results-list-from-process
  2013-06-20  2:16 ` Stefan Monnier
@ 2013-06-20  8:04   ` Leo Liu
  2013-06-20 20:17     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Liu @ 2013-06-20  8:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

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))



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: random 1 second delay in comint-redirect-results-list-from-process
  2013-06-20  8:04   ` Leo Liu
@ 2013-06-20 20:17     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2013-06-20 20:17 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

>        (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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-20 20:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20  0:06 random 1 second delay in comint-redirect-results-list-from-process Leo Liu
2013-06-20  2:16 ` Stefan Monnier
2013-06-20  8:04   ` Leo Liu
2013-06-20 20:17     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.