bug-gnu-emacs
[Top][All Lists]
Advanced

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

accept-process-output incompatible change in CVS Emacs: patch included


From: Per Cederqvist
Subject: accept-process-output incompatible change in CVS Emacs: patch included
Date: 04 May 2007 10:56:47 +0200

This change in the upcoming Emacs 22 breaks some code:

> 2006-03-22  Kim F. Storm  <storm@cua.dk>
> 
>       * process.c (Faccept_process_output): Fix to comply with lisp
>       reference.  Change arg "timeout" to "seconds" and allow both
>       integer and float value.  Change arg "timeout-msec" to "millisec"
>       and interpret" as milliseconds rather than microseconds.  Fix doc
>       string accordingly.

I enclose a patch that makes accept-process-output
backwards-compatible with Emacs 21.

One application I'm running now runs very slowly, since its carefully
tuned timeoutes are multiplied by 1000.

The third argument of the accept-process-output function used to be a
number of microseconds.  Apparently whoever wrote the GNU Emacs Lisp
Reference Manual mistook "msec" to mean milliseconds.  But the
built-in documentation in Emacs 21.3 clearly states that the argument
is in milliseconds:

> accept-process-output is a built-in function.
> (accept-process-output &optional PROCESS TIMEOUT TIMEOUT-MSECS)
> 
> Allow any pending output from subprocesses to be read by Emacs.
> It is read into the process' buffers or given to their filter functions.
> Non-nil arg PROCESS means do not return until some output has been received
> from PROCESS.
> 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.
> Return non-nil iff we received any output before the timeout expired.

I guess it would make some sense to change it to nanoseconds with
todays faster computers with high-resolution timers.  But since Emacs
has floating point support, and the "seconds" argument now can be a
float, I don't think that is necessary.

To decrease the resolution seems wrong.  This change should be
reverted, and the reference manual updated instead.

Please fix this in Emacs 22 if possible, since this change breaks
existing code.  If, for some reason, my patch is unacceptable, please
mention this as an incompatible change in the NEWS file.

    /ceder
-- 
Per Cederqvist <ceder@lysator.liu.se>

Attachment: patch
Description: revert third argument of accept-process-output


reply via email to

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