Subject: Re: bug#49261: 28.0.50; File Locking Breaks Presumptuous Toolchains

From: Juri Linkov <[email-masked]>
Date: Wed, 30 Jun 2021 22:31:33 +0300

> For auto-save files, that's auto-save-file-name-transforms.
> For backup files, that's backup-directory-alist.
> For lock files, they can be switched off with create-lockfiles.
>
> Would it make sense to allow the user to control where the lockfiles are
> written?  The lockfiles are symlinks, so it should theoretically be
> possible to have them elsewhere without being any racier than the code
> currently is, I think.
>
> Any opinions?

This is a real problem.  To avoid syncing temporary files,
it's easy to add a pair of lines for every such directory:

  (add-to-list 'auto-save-file-name-transforms '("\\`/dir1/dir2/.*" "/tmp/" t))
  (add-to-list 'backup-directory-alist         '("\\`/dir1/dir2/.*" . "/tmp/"))

Then it creates temporary files whose names contain absolute paths:

  /tmp/!dir1/dir2!file~
  /tmp/#!dir1/dir2!file#

But currently no way to do the same for lock files, so need to take care
not to forget to add the same pattern in every .stignore in every sync directory
to ignore lock files that is extra trouble:

  .#*