[Top][All Lists]

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

Re: A few questions about desktop.el

From: Juri Linkov
Subject: Re: A few questions about desktop.el
Date: Sun, 10 Jun 2007 00:31:28 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>> I have in .emacs
>>     (run-at-time 3600 3600 'desktop-save "~")
>> so desktop-save silently saves the desktop every hour.
>> Does you patch cause a problem by asking questions about file locks
>> inside such a timer?
> Er, I'm guessing it does... it certainly doesn't check to see if it's
> being run in a less than interactive fashion.  (How does one even do that?
>  Either of the standard interactive checks?)  But the real question is
> what would you want it to do there instead of ask?
>  - Is this sort of call supposed to automatically get priority and steal
> locks and such?  If so, what happens when two Emacs instances run this
> timer (as in interleaved, not even simultaneously)?

Overwriting the desktop of another Emacs instance is not a good thing to do.

>  - Alternatively, is it supposed to always fail if a clash is detected?

Not writing the desktop would be acceptable if it displayed a message
about this failure.

>  - Or should there be entirely different heuristics...?

Another alternative is to write the desktop file with a different name.

> I guess I should note (partly just to give this message more than one
> declarative sentence) that if you don't save the desktop from another
> Emacs (even if you start one and re-use this autosaved desktop), it won't
> prompt the next time the timer runs.  So if you actually "respect" the
> clash detection and don't create a conflicting desktop, there won't be a
> problem.

All on all, we could leave this to the user's discretion.  The user should be
careful about not creating a configuration where two Emacs instances
automatically write to the same file.

Juri Linkov

reply via email to

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