[Top][All Lists]

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

Re: [Emacs-diffs] trunk r116304: * lisp/desktop.el (desktop-read): Claim

From: Juri Linkov
Subject: Re: [Emacs-diffs] trunk r116304: * lisp/desktop.el (desktop-read): Claim the lock when the owner is not the current process.
Date: Sat, 08 Feb 2014 21:32:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)

>> Maybe we need a separate question in addition to the existing question
>> 1. "Warning: desktop file appears to be in use by PID %s.
>>     Using it may cause conflicts.  Use it anyway? "
>> something like
>> 2. "Claim the lock from PID %s to take the ownership of the desktop file? "
> Something like that, but it needs to be possible to configure it to
> not ask/not claim, if that's what the user wants.

Then instead of asking a question we could add two new values
to `desktop-load-locked-desktop'

   ask-and-lock  -- ask the user and lock the desktop.
   load-and-lock -- load and lock anyway.

with the default to `ask-and-lock'.  Whereas the existing

   t    -- load anyway.
   ask  -- ask the user.

will load without locking.

> As an example, in my .emacs, I set desktop-load-locked-desktop to nil,
> and then I add code to desktop-not-loaded-hook that only steals the
> lock if the PID of the old lock does not match a running Emacs
> instance; if the old Emacs is still running I only throw a warning.

I guess your code to detect a running Emacs instance is not too reliable
to include to desktop.el?

reply via email to

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