From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: idledo.el v. 0.3 Date: 24 Oct 2002 12:48:34 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xadl4p0xp.fsf@kfs2.cua.dk> References: <87wuobakqz.fsf@computer.localdomain> <5xfzuyqbxo.fsf@kfs2.cua.dk> <874rbduxdf.fsf@computer.localdomain> <5xbs5ljj6s.fsf@kfs2.cua.dk> <87u1jcq1ex.fsf@computer.localdomain> <5xy98ozpfj.fsf@kfs2.cua.dk> <87bs5kbuzm.fsf@computer.localdomain> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035453016 20105 80.91.224.249 (24 Oct 2002 09:50:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 24 Oct 2002 09:50:16 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 184ed4-0005E8-00 for ; Thu, 24 Oct 2002 11:50:14 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 184efC-0000iS-00 for ; Thu, 24 Oct 2002 11:52:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 184ec8-00081K-00; Thu, 24 Oct 2002 05:49:16 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 184ebM-0006t2-00 for emacs-devel@gnu.org; Thu, 24 Oct 2002 05:48:28 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 184ebK-0006q4-00 for emacs-devel@gnu.org; Thu, 24 Oct 2002 05:48:28 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10) id 184ebJ-0006q0-00 for emacs-devel@gnu.org; Thu, 24 Oct 2002 05:48:26 -0400 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id E370A7C017; Thu, 24 Oct 2002 09:48:24 +0000 (GMT) Original-To: "D. Goel" In-Reply-To: <87bs5kbuzm.fsf@computer.localdomain> Original-Lines: 64 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8729 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8729 "D. Goel" writes: > run-with-idle-timer (secs repeat function &rest args) > > Current functionality: > > If REPEAT is non-nil, do the action each time Emacs has been idle for > exactly SECS seconds (that is, only once for each time Emacs becomes idle). > > > Are you suggesting instead that: > (1) > [...] (1) almost described what I had in mind: If REPEAT is non-nil, do the action each time Emacs has been idle for exactly SECS seconds. If REPEAT is a number, keep repeating the action every REPEAT seconds as long as emacs remains idle; otherise, only do the action once for each time Emacs becomes idle. > or that: > (2) > If REPEAT is t, do the action each time Emacs has been idle for > exactly SECS seconds (that is, only once for each time Emacs becomes idle). > > If REPEAT is a number, do the subsequent action each time Emacs has been idle > for exactly REPEAT seconds (that is, only once for each time Emacs > becomes idle). > ? > > > The second one makes more sense to me, since REPEAT in > run-with-idle-timer deals not with repeat-while-idle but with > REPEAT-when-next-idle... Yes, formally it makes more sense, but I cannot see any purpose for that functionality -- whereas the proposed functionality is definitely useful! > OTOH, the first one would (incompletely) mix > the 2 different booleans/numbers into one REPEAT.. Yes, it is true that with my proposal it is not possible to specify an idle timer which is repeated while emacs remains idle, but does not get repeated the next time emacs becomes idle --- but again, I really don't see much use for that functionality either. So although the proposed "overloading" of the REPEAT argument for run-with-idle-timer does not cover every possible combination, I think it covers all the practical functions (in all cases the action is first executed SECS seconds after emacs becomes idle): - not repeating the idle action at all (REPEAT = nil) - repeating (once) every time emacs becomes idle (REPEAT = t) - repeating every time emacs becomes idle, and then every REPEAT seconds while emacs remains idle (REPEAT = number) -- Kim F. Storm http://www.cua.dk