emacs-devel
[Top][All Lists]
Advanced

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

Re: sleep-for documentation and how to pause reliably


From: Eli Zaretskii
Subject: Re: sleep-for documentation and how to pause reliably
Date: Fri, 15 Feb 2013 15:18:53 +0200

> From: Thierry Volpiatto <address@hidden>
> Date: Fri, 15 Feb 2013 11:19:27 +0100
> 
> > Am I missing something?  If not, apart of fixing the docs, _is_ there
> > any way to wait reliably when async subprocesses are running and
> > producing output?
> What about using a sentinel?
> 
> (progn
>   (let ((proc (start-process-shell-command "ls" nil "ls")))
>     (set-process-sentinel proc #'(lambda (process event)
>                                    (when (string= event "finished\n"))
>                                    (sleep-for 20)
>                                    (message "hi after 20s sleeping"))))
>   (message "Hi now sleeping 20s"))

Thanks, but that's not what I meant.  I meant, suppose you must
reliably wait in a Lisp program that doesn't launch any subprocesses,
but should always wait for N seconds even if there are some async
subprocesses running in parallel.  IOW, the code that must pause
doesn't itself launch any subprocesses, it just needs to wait.



reply via email to

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