From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: D. Goel Newsgroups: gmane.emacs.devel Subject: Re: idledo.el v. 0.3 Date: 24 Oct 2002 08:06:54 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <8765vshwgx.fsf@computer.localdomain> 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> <5xadl4p0xp.fsf@kfs2.cua.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035461373 17082 80.91.224.249 (24 Oct 2002 12:09:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 24 Oct 2002 12:09:33 +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 184gns-0004RO-00 for ; Thu, 24 Oct 2002 14:09:32 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 184gq2-0003kL-00 for ; Thu, 24 Oct 2002 14:11:46 +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 184glf-0008Lb-00; Thu, 24 Oct 2002 08:07:15 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 184glQ-00080o-00 for emacs-devel@gnu.org; Thu, 24 Oct 2002 08:07:00 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 184glO-00080W-00 for emacs-devel@gnu.org; Thu, 24 Oct 2002 08:07:00 -0400 Original-Received: from 24-197-159-102.charterga.net ([24.197.159.102] helo=computer) by monty-python.gnu.org with esmtp (Exim 4.10) id 184glN-00080Q-00 for emacs-devel@gnu.org; Thu, 24 Oct 2002 08:06:57 -0400 Original-Received: from deego by computer with local (Exim 3.36 #1 (Debian)) id 184glL-0005WQ-00; Thu, 24 Oct 2002 08:06:55 -0400 Original-To: storm@cua.dk (Kim F. Storm) X-Face: "p/v9J8=S2*s}DfZ-:.li?No&/cFtNt5?~xJBn1&M!s7;LkMg[q@o*COk:?QGvQVt,-34q7 ,Bn-_uph,+$dkf8HOP==kgg:o7;Y,+F/3wC_{YqPteeqTjs+Ey=V%n^|gWVbO(VCMt/s^RWLpl#= In-Reply-To: <5xadl4p0xp.fsf@kfs2.cua.dk> Original-Lines: 61 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 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:8731 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8731 storm@cua.dk (Kim F. Storm) writes: >(1) > 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. > 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) > Indeed. Your proposal does cover all useful cases. I like it! > > 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. IMHO, This one is the only "important" case that does not get covered. Though it may seldom be needed in practice, it would seem awkward to leave this out. Moreover, providing additional arguments to cover this "missing" situation would break the backward compatibility of run-with-idle-timer. So, this user seconds your proposal! However, a user who does want to implement the "missing" functionality will again do weird stuff, as done in blink-cursor-mode and idledo.el. OTOH, the user can cleanly implement the missing functionality if one would provide one or more of the following variables. (I guess one could also provide appropriate hooks instead of variables.) idle-timer-idle-counter "When running an idle-timer, this variable is (temporarily) bound to the number of times the idle-timer has been triggered by emacs going idle.. " idle-timer-repeat-counter "when running an idle-timer, this variable is temporarily bound to the number of times the idle-timer has been triggered , either by emacs going idle, or by emacs remaining idle. " DG http://deego.gnufans.org/~deego/ --