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: Kim F. Storm
Subject: Re: idledo.el v. 0.3
Date: 24 Oct 2002 12:48:34 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

"D. Goel" <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

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