emacs-devel
[Top][All Lists]
Advanced

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

Re: desktop.el: autosave?


From: Juri Linkov
Subject: Re: desktop.el: autosave?
Date: Thu, 06 Dec 2007 01:41:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

>>>Wouldn't it be sufficient to have one idle timer which triggers
>>>auto-saving only if some timeout has elapsed since the last auto-save
>>>of the desktop?
>>
>> It seems this is not possible with idle timers because they use timeout
>> elapsed since the last user input, not the last time they run.
>
> Ahh no.  I meant using an extra variable which records the last autosave
> date.  Whenever the routine triggered by the idle timer detects that the
> period (one hour ...) has elapsed (by comparing that variable's value
> with the present time) it does autosave and reset that variable.  This
> would only fail when an idle time starts before the autosave timeout has
> expired and terminates long after that.

Yes, this is not a reliable solution since an idle timer may fail to run
at the requested time.  I think your first idea is better.

I wonder why standard timers don't do something like that: run a function
after a long timeout (e.g. several minutes) but only if Emacs is idle for
a few seconds.  This looks like an useful behavior.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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