emacs-devel
[Top][All Lists]
Advanced

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

Re: idledo.el v. 0.3


From: D . Goel
Subject: Re: idledo.el v. 0.3
Date: 24 Oct 2002 08:06:54 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

address@hidden (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/
--




reply via email to

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