emacs-devel
[Top][All Lists]
Advanced

[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: Wed, 03 May 2006 15:48:57 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>     Two things are done: first, a desktop file is modified when it is read
>     (without incident) to include a "in use" tag; further Emacses will
>     complain about this if they see it, and will leave the desktop file
>     unloaded unless the user accepts the collision risk.
>
> I think it is somewhat dangerous to modify the file when reading it.
> My experience tells me that that can lead to various problems in weird
> cases, and it is much better if operations that only look at data
> are written so that they do not change anything.
>
> Can you use a different file name for the "in use" marker?

Wouldn't it be better to use Emacs standard file locking mechanism,
i.e. after reading a desktop file to mark the desktop file's buffer
as modified?  This ensures that trying to save the desktop in another
Emacs session will raise a question about stealing/leaving the lock.

Another simpler solution (without touching the desktop file's buffer) is
to remember the desktop file's timestamp after reading it, and before
saving it compare it with the old timestamp, and ask the question about
whether to override it or not.

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





reply via email to

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