unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* accept-process-output  doc string vs. lispref
@ 2006-03-22 21:36 Kim F. Storm
  2006-03-22 21:55 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Kim F. Storm @ 2006-03-22 21:36 UTC (permalink / raw)



There is a _BIG_ problem between the doc string and lispref 
for the accept-process-output function:

DOC STRING:

(accept-process-output &optional process timeout timeout-msecs just-this-one)
..
Non-nil second arg timeout and third arg timeout-msecs are number of
seconds and microseconds to wait; return after that much time whether
or not there is input.

LISP REF:

 - Function: accept-process-output &optional process seconds millisec just-this-one

     The arguments SECONDS and MILLISEC let you specify timeout
     periods.  The former specifies a period measured in seconds and the
     latter specifies one measured in milliseconds.  The two time
     periods thus specified are added together, and
     `accept-process-output' returns after that much time whether or
     not there has been any subprocess output.


So doc string says that "timeout-msecs" is in MICRO seconds, while
the lisp ref says "millisec" is in MILLI seconds.

The doc string has been like that since 1991, and the lisp ref since 1994.

The C-code interprets it as MICRO seconds, so the doc string is correct.

However, the name of the parameter "msecs" is misleading.


I also checked Xemacs, and it interprets the argument as MILLI seconds.


The recently reported problem with gnus looping in gettimeofday and
accept-process-output (IIRC) can probably be attributed to gnus
using a timeout on accept-process-output of msec=100, i.e. 0.0001 second.

Looking at the code, it clearly expects the arg to be interpreted as
100 MILLI seconds.  I have also checked all other uses of
accept-process-output, and all code that sets timeout-msec expects it
to be MILLI seconds.

On Linux [the kernel], the minimum time-difference is typically 0.01
second, so having a resolution in MICRO seconds is pretty useless;
MILLI seconds is fully adequate


I will change the interpretation from MICRO to MILLI seconds to align
the code and doc string with 1) the LISP REF, and 2) all uses of the
function.

--
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: accept-process-output  doc string vs. lispref
  2006-03-22 21:36 accept-process-output doc string vs. lispref Kim F. Storm
@ 2006-03-22 21:55 ` Stefan Monnier
  2006-03-22 22:23   ` Kim F. Storm
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2006-03-22 21:55 UTC (permalink / raw)
  Cc: emacs-devel

> I will change the interpretation from MICRO to MILLI seconds to align
> the code and doc string with 1) the LISP REF, and 2) all uses of the
> function.

While you're there, plase make it possible to use a float for `timeout', as
is done in sit-for.


        Stefan

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

* Re: accept-process-output  doc string vs. lispref
  2006-03-22 21:55 ` Stefan Monnier
@ 2006-03-22 22:23   ` Kim F. Storm
  2006-03-22 22:46     ` Kim F. Storm
  0 siblings, 1 reply; 4+ messages in thread
From: Kim F. Storm @ 2006-03-22 22:23 UTC (permalink / raw)
  Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I will change the interpretation from MICRO to MILLI seconds to align
>> the code and doc string with 1) the LISP REF, and 2) all uses of the
>> function.
>
> While you're there, plase make it possible to use a float for `timeout', as
> is done in sit-for.

I will do that.  

The LISPREF already says this is possible -- it did so 16 years ago :-)

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: accept-process-output  doc string vs. lispref
  2006-03-22 22:23   ` Kim F. Storm
@ 2006-03-22 22:46     ` Kim F. Storm
  0 siblings, 0 replies; 4+ messages in thread
From: Kim F. Storm @ 2006-03-22 22:46 UTC (permalink / raw)


storm@cua.dk (Kim F. Storm) writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> I will change the interpretation from MICRO to MILLI seconds to align
>>> the code and doc string with 1) the LISP REF, and 2) all uses of the
>>> function.
>>
>> While you're there, plase make it possible to use a float for `timeout', as
>> is done in sit-for.
>
> I will do that.  
>
> The LISPREF already says this is possible -- it did so 16 years ago :-)

I have installed the changes.


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

end of thread, other threads:[~2006-03-22 22:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-22 21:36 accept-process-output doc string vs. lispref Kim F. Storm
2006-03-22 21:55 ` Stefan Monnier
2006-03-22 22:23   ` Kim F. Storm
2006-03-22 22:46     ` Kim F. Storm

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).