From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: jit-lock timer etc. Date: Thu, 24 Aug 2006 10:47:35 -0400 Message-ID: <87r6z68a2g.fsf@furball.mit.edu> References: <44E9E5F5.8000400@gmx.at> <87fyfpq5wf.fsf@stupidchicken.com> <44EA3222.9050405@gmx.at> <44EC49AD.2080001@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156430912 9874 80.91.229.2 (24 Aug 2006 14:48:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 Aug 2006 14:48:32 +0000 (UTC) Cc: rudalics@gmx.at, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 24 16:48:30 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GGGV9-0002BD-M6 for ged-emacs-devel@m.gmane.org; Thu, 24 Aug 2006 16:48:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGGV9-0000aq-4o for ged-emacs-devel@m.gmane.org; Thu, 24 Aug 2006 10:48:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GGGUt-0000Va-Bf for emacs-devel@gnu.org; Thu, 24 Aug 2006 10:47:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGGUs-0000US-Rb for emacs-devel@gnu.org; Thu, 24 Aug 2006 10:47:54 -0400 Original-Received: from [18.72.1.2] (helo=south-station-annex.mit.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GGGcx-0001Px-Gi; Thu, 24 Aug 2006 10:56:15 -0400 Original-Received: from grand-central-station.mit.edu (GRAND-CENTRAL-STATION.MIT.EDU [18.7.21.82]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id k7OElnEN015126; Thu, 24 Aug 2006 10:47:49 -0400 (EDT) Original-Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by grand-central-station.mit.edu (8.13.6/8.9.2) with ESMTP id k7OElhRr010201; Thu, 24 Aug 2006 10:47:44 -0400 (EDT) Original-Received: from furball.mit.edu (SYDNEYPACIFIC-THREE-NINETY-NINE.MIT.EDU [18.95.6.144]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id k7OElVj8025637; Thu, 24 Aug 2006 10:47:32 -0400 (EDT) Original-Received: from cyd by furball.mit.edu with local (Exim 3.36 #1 (Debian)) id 1GGGUZ-0000ib-00; Thu, 24 Aug 2006 10:47:35 -0400 Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Thu, 24 Aug 2006 11:07:49 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-Spam-Score: 1.217 X-Scanned-By: MIMEDefang 2.42 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58812 Archived-At: storm@cua.dk (Kim F. Storm) writes: >> Shall I fix current-idle-time to return a float or nil? A more correct course of action is to leave current-idle-time the way it is, and extend timer-set-idle-time to accept the internal time format, analogously to timer-set-time. Then we can submit the value of current-idle-time directly to timer-set-idle-time. *** emacs/lisp/emacs-lisp/timer.el.~1.12.~ 2006-08-20 09:55:37.000000000 -0400 --- emacs/lisp/emacs-lisp/timer.el 2006-08-24 10:45:48.000000000 -0400 *************** *** 60,73 **** (defun timer-set-idle-time (timer secs &optional repeat) "Set the trigger idle time of TIMER to SECS. If optional third argument REPEAT is non-nil, make the timer fire each time Emacs is idle for that many seconds." (or (timerp timer) (error "Invalid timer")) ! (aset timer 1 0) ! (aset timer 2 0) ! (aset timer 3 0) ! (timer-inc-time timer secs) (aset timer 4 repeat) timer) --- 60,81 ---- (defun timer-set-idle-time (timer secs &optional repeat) "Set the trigger idle time of TIMER to SECS. + SECS may be an integer, floating point number, or the internal + time format (HIGH LOW USECS) returned by, e.g., `current-time'. If optional third argument REPEAT is non-nil, make the timer fire each time Emacs is idle for that many seconds." (or (timerp timer) (error "Invalid timer")) ! (if (consp secs) ! (progn (aset timer 1 (car secs)) ! (aset timer 2 (if (consp (cdr time)) (car (cdr time)) (cdr time))) ! (aset timer 3 (or (and (consp (cdr time)) (consp (cdr (cdr time))) ! (nth 2 time)) ! 0))) ! (aset timer 1 0) ! (aset timer 2 0) ! (aset timer 3 0) ! (timer-inc-time timer secs)) (aset timer 4 repeat) timer) *************** *** 104,110 **** (defun timer-relative-time (time secs &optional usecs) "Advance TIME by SECS seconds and optionally USECS microseconds. ! SECS may be a fraction." (let ((high (car time)) (low (if (consp (cdr time)) (nth 1 time) (cdr time))) (micro (if (numberp (car-safe (cdr-safe (cdr time)))) --- 112,118 ---- (defun timer-relative-time (time secs &optional usecs) "Advance TIME by SECS seconds and optionally USECS microseconds. ! SECS may be either an integer or a floating point number." (let ((high (car time)) (low (if (consp (cdr time)) (nth 1 time) (cdr time))) (micro (if (numberp (car-safe (cdr-safe (cdr time))))