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: Fri, 07 Dec 2007 01:29:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

>     It occurred to me because Juri wanted to auto-save the desktop only
>     every hour.  Hence, I'd first wait for an hour and then until Emacs
>     has become idle for at least five minutes.
>
> One cannot argue with tastes, but one drawback is that if he never
> takes a 5-minute break, it will never auto-save the desktop.

Martin's idea would work if the idle timer's timeout is proportional to
the time required to save the desktop (a few seconds).  So the algorithm
would be the following: at large intervals (tens of minutes) a non-idle
timer will start an idle timer to wait for appropriate time within the
next few seconds of idle time.  The reason is that when saving the desktop
requires e.g. 1 sec then after 5 sec of idle time it is likely that it
finishes saving before the user notices the delay caused by saving.

> That's why I suggest auto-saving whenever Emacs is idle for N minutes
> _or_ H hours have elapsed since the last save.  If you take breaks
> often enough, it will save in the breaks and only in the breaks.
> But if you don't take breaks, it will eventually save anyway.

If the idea above is not acceptable then having two separate timers with
separately configured timeouts is not bad, because when necessary the user
can disable one of the two timers.

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




reply via email to

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