From: Eli Zaretskii <eliz@gnu.org>
To: Angelo Graziosi <angelo.g0@libero.it>
Cc: emacs-devel@gnu.org
Subject: Re: How to stop desktop.lock file creation
Date: Sun, 27 Mar 2022 08:03:14 +0300 [thread overview]
Message-ID: <83leww9ect.fsf@gnu.org> (raw)
In-Reply-To: <1611306500.320421.1648330200906@mail1.libero.it> (message from Angelo Graziosi on Sat, 26 Mar 2022 22:30:00 +0100 (CET))
> Date: Sat, 26 Mar 2022 22:30:00 +0100 (CET)
> From: Angelo Graziosi <angelo.g0@libero.it>
> Cc: emacs-devel@gnu.org
>
> > You don't need to play this game. If you set
> > desktop-load-locked-desktop to t, Emacs will unconditionally load the
> > desktop even if locked, no questions asked. Its effect is the same as
> > not having the lock at all, when the process which locked the desktop
> > no longer runs.
>
> When Emacs ask for loading the desktop file it says
>
> "Warning: desktop file appears to be in use by PID xyza.
> Using it may cause conflicts. Use it anyway? (y or n)"
>
> So, _if it says that could be conflicts_, in my opinion, the best way to go is to accept it, close Emacs, restart Emacs, so that it starts in a clean state.
What it wants to say that it doesn't know whether the process that
locked the desktop file is still running. If it is still running,
then yes, using this file in two Emacs processes could cause
conflicts. And please note that the process which locked it could run
on another computer. If that process is not running, there could be
no conflicts, and it is safe to answer "y".
> Why I have to to all this? Really I need this? or should I accept with the risk of conflicts (i am sure they do not occur!)?
You should verify (or in your case know in advance) that the locking
Emacs process no longer runs.
> > > Emacs worked the same before its introduction...
> >
> > The lock was introduced in Emacs 22.2, quite some time ago. It isn't
> > a new feature.
>
> I know this and it is what I did mean.
>
> If users could live without the lock file until version 22 why can't they live without it with the current version?
The lock was introduced to handle the cases in which users did
encounter conflicts by using the same desktop file from two or more
Emacs processes. See
https://lists.gnu.org/archive/html/emacs-devel/2006-04/msg01253.html
> In short: really we need this lock file?
Yes, IMO.
> really it is useful in all situations?
It is a safety net that is definitely useful in some situations. As
any safety net, it can sometimes produce false positives, and we are
working on making those more rare. For example, Emacs 29 will have an
additional value of desktop-load-locked-desktop that will be capable
of taking the lock silently if it was locked by a local process that
is no longer running.
> Why not adding a flag to avoid its creation and that the user sets at its own risk?
Because we think desktop-load-locked-desktop is that flag.
prev parent reply other threads:[~2022-03-27 5:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 22:33 How to stop desktop.lock file creation Angelo Graziosi
2022-03-25 6:34 ` Eli Zaretskii
2022-03-25 22:53 ` Angelo Graziosi
2022-03-26 5:48 ` Eli Zaretskii
2022-03-26 21:30 ` Angelo Graziosi
2022-03-27 5:03 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83leww9ect.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=angelo.g0@libero.it \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.