bug#31908: Save file locks in centralized location

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#31908: Save file locks in centralized location

Radon Rosborough
While you have an unsaved buffer, Emacs creates a lock file [1] in the
current directory. This is useful to prevent concurrent edits, but it
is also annoying to have the extra file around: for example, if you
save frequently while you have a Dired pane with a fast Auto Revert
enabled in another window, the lock file will keep appearing and
disappearing rapidly.

I wish for Emacs to save its lock files in some subdirectory of my
`user-emacs-directory', rather than in the same directory as the file
under consideration. Is that possible? If not, is it possible to
implement the feature someday?

I found no relevant discussion on the bug tracker or on emacs-devel,
and I only found the discouraging [2] on Stack Exchange.

[1]: https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Locks.html
[2]: https://emacs.stackexchange.com/q/5967/12534



Reply | Threaded
Open this post in threaded view
|

bug#31908: Save file locks in centralized location

Phil Sainty
If users had their own custom location for locks, surely the locking
would cease to have any significant purpose, because no one would ever
see a lock created by someone else?

The utility would be reduced to preventing you from simultaneously
using multiple separate emacs instances to edit/write a given file.


-Phil




Reply | Threaded
Open this post in threaded view
|

bug#31908: Save file locks in centralized location

Radon Rosborough
> If users had their own custom location for locks, surely the locking
> would cease to have any significant purpose [...] The utility would
> be reduced to preventing you from simultaneously using multiple
> separate emacs instances to edit/write a given file.

I run a single-user system; preventing concurrent edits is the only
purpose of the locking mechanism for me. This feature would hardly
remove "any significant purpose" from it.



Reply | Threaded
Open this post in threaded view
|

bug#31908: Save file locks in centralized location

Robert Pluim
Radon Rosborough <[hidden email]> writes:

>> If users had their own custom location for locks, surely the locking
>> would cease to have any significant purpose [...] The utility would
>> be reduced to preventing you from simultaneously using multiple
>> separate emacs instances to edit/write a given file.
>
> I run a single-user system; preventing concurrent edits is the only
> purpose of the locking mechanism for me. This feature would hardly
> remove "any significant purpose" from it.

If implemented, this feature would almost certainly be off by default,
so no existing users would end up being surprised.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#31908: Save file locks in centralized location

Radon Rosborough
> If implemented, this feature would almost certainly be off by
> default, so no existing users would end up being surprised.

That doesn't bother me in the slightest, and I agree with your
conclusion.



Reply | Threaded
Open this post in threaded view
|

bug#31908: Save file locks in centralized location

Mauro Mandracchia
In reply to this post by Radon Rosborough
Is there any update on this?
Reply | Threaded
Open this post in threaded view
|

bug#31908: Save file locks in centralized location

Eli Zaretskii
> From: Mauro Mandracchia <[hidden email]>
> Date: Wed, 6 Feb 2019 19:35:11 +0100
>
> Is there any update on this?

Not that I know of, sorry.  Patches to implement this are welcome.