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: Lars Hansen
Subject: Re: A few questions about desktop.el
Date: Wed, 03 May 2006 16:37:37 +0200
User-agent: Debian Thunderbird 1.0.2 (X11/20051002)

Juri Linkov wrote:

>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.
>  
>
I like the idea of using the standard locking mechanism, but I don't
like to mark an unmodified buffer as modified.

I think the desktop file should be locked as soon as we know it is going
to be changed when Emacs exits, i.e. when desktop-save-mode is turned
on. And if desktop-save-mode is turned off, the desktop file should be
unlocked if its buffer is unmodified. So maybe lock-buffer should have
an optional parameter LOCK-UNMODIFIED to make it usable in such cases (I
take it this is an after-the-release discussion.)

I guess the same type of problem exists for .recentf, .emacs-places,
.emacs-history and maybe other files. The problem should be handled in
the same way for all these files.

>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.
>  
>
This is pleasingly simple, but then the question would be asked when
Emacs is exited rather than when it is started. IMHO, the question
should be asked as soon as the problem is detected, i.e. when the second
Emacs is started (if desktop-save-mode is turned on).




reply via email to

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