From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Per Cederqvist Newsgroups: gmane.emacs.bugs Subject: accept-process-output incompatible change in CVS Emacs: patch included Date: 04 May 2007 10:56:47 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1178296084 2652 80.91.229.12 (4 May 2007 16:28:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 4 May 2007 16:28:04 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 04 18:28:03 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hk0dP-0006IQ-C3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 May 2007 18:27:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hk0k3-0004ca-Hb for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 May 2007 12:34:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hjthm-00066P-8U for bug-gnu-emacs@gnu.org; Fri, 04 May 2007 05:03:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hjthk-00063N-PM for bug-gnu-emacs@gnu.org; Fri, 04 May 2007 05:03:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hjthk-00062Y-6U for bug-gnu-emacs@gnu.org; Fri, 04 May 2007 05:03:56 -0400 Original-Received: from usagi.ingate.se ([193.180.23.12]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hjtb7-000069-94 for bug-gnu-emacs@gnu.org; Fri, 04 May 2007 04:57:05 -0400 Original-Received: from rapture.ingate.se (rapture.ingate.se [193.180.23.42]) by usagi.ingate.se (8.12.11.20060308/8.12.11) with ESMTP id l448v2wt016601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 4 May 2007 10:57:02 +0200 Original-Received: from rapture.ingate.se (localhost.localdomain [127.0.0.1]) by rapture.ingate.se (8.13.1/8.12.11) with ESMTP id l448uvWP007348; Fri, 4 May 2007 10:56:57 +0200 Original-Received: (from ceder@localhost) by rapture.ingate.se (8.13.1/8.13.1/Submit) id l448ultc007339; Fri, 4 May 2007 10:56:47 +0200 X-Authentication-Warning: rapture.ingate.se: ceder set sender to ceder@ingate.com using -f Original-Lines: 51 X-Virus-Scanned: ClamAV version 0.90.2, clamav-milter version 0.90.2 on usagi.ingate.se X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (usagi.ingate.se [193.180.23.12]); Fri, 04 May 2007 10:57:02 +0200 (CEST) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Fri, 04 May 2007 12:34:45 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15688 Archived-At: --=-=-= This change in the upcoming Emacs 22 breaks some code: > 2006-03-22 Kim F. Storm > > * 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 --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: attachment; filename=patch Content-Transfer-Encoding: quoted-printable Content-Description: revert third argument of accept-process-output Index: src/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/ChangeLog,v retrieving revision 1.5658 diff -u -r1.5658 ChangeLog --- src/ChangeLog 1 May 2007 08:15:56 -0000 1.5658 +++ src/ChangeLog 3 May 2007 12:40:24 -0000 @@ -1,3 +1,10 @@ +2007-05-03 Per Cederqvist + + * process.c (Faccept_process_output): Revert 2006-03-22 change so + that the third argument once again is in microseconds (not + milliseconds). This makes it compatible with Emacs 21 and + earlier. Problem found by Henrik Rindl=F6w. + 2007-05-01 YAMAMOTO Mitsuharu =20 * macmenu.c (mac_dialog_show): Apply 2007-04-27 change for xmenu.c. Index: src/process.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/process.c,v retrieving revision 1.512 diff -u -r1.512 process.c --- src/process.c 23 Apr 2007 21:27:40 -0000 1.512 +++ src/process.c 3 May 2007 12:40:25 -0000 @@ -3912,8 +3912,8 @@ Non-nil arg PROCESS means do not return until some output has been received from PROCESS. =20 -Non-nil second arg SECONDS and third arg MILLISEC are number of -seconds and milliseconds to wait; return after that much time whether +Non-nil second arg SECONDS and third arg MICROSEC are number of +seconds and microseconds to wait; return after that much time whether or not there is input. If SECONDS is a floating point number, it specifies a fractional number of seconds to wait. =20 @@ -3921,8 +3921,8 @@ from PROCESS, suspending reading output from other processes. If JUST-THIS-ONE is an integer, don't run any timers either. Return non-nil iff we received any output before the timeout expired. */) - (process, seconds, millisec, just_this_one) - register Lisp_Object process, seconds, millisec, just_this_one; + (process, seconds, microsec, just_this_one) + register Lisp_Object process, seconds, microsec, just_this_one; { int secs, usecs =3D 0; =20 @@ -3944,10 +3944,10 @@ else wrong_type_argument (Qnumberp, seconds); =20 - if (INTEGERP (millisec)) + if (INTEGERP (microsec)) { int carry; - usecs +=3D XINT (millisec) * 1000; + usecs +=3D XINT (microsec); carry =3D usecs / 1000000; secs +=3D carry; if ((usecs -=3D carry * 1000000) < 0) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs --=-=-=--