Variable: lock-file-name-transforms

lock-file-name-transforms is a customizable variable defined in files.el.gz.

Value

nil

Documentation

Transforms to apply to buffer file name before making a lock file name.

This has the same syntax as auto-save-file-name-transforms, but applies to lock file names instead of auto-save file names.

By default, Emacs puts each lock file into the same directory as the file it locks, prepending ".#" to the base file name.

Note that changing this could break lock file functionality, e.g.: if different users access the same file, using different lock file settings; if accessing files on a shared file system from different hosts, using a transform that puts the lock files on a local file system.

This variable was added, or its default value changed, in Emacs 28.1.

View in manual

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defcustom lock-file-name-transforms nil
  "Transforms to apply to buffer file name before making a lock file name.
This has the same syntax as `auto-save-file-name-transforms',
but applies to lock file names instead of auto-save file names.

By default, Emacs puts each lock file into the same directory as the
file it locks, prepending \".#\" to the base file name.

Note that changing this could break lock file functionality, e.g.:
if different users access the same file, using different lock file settings;
if accessing files on a shared file system from different hosts,
using a transform that puts the lock files on a local file system."
  :group 'files
  :type `(repeat (list (regexp :tag "Regexp")
                       (string :tag "Replacement")
                       (choice
                        (const :tag "Uniquify" t)
                        ,@(mapcar (lambda (algo)
                                    (list 'const algo))
                                  (secure-hash-algorithms)))))
  :version "28.1")