variable @code{remote-file-name-inhibit-locks} to @code{t}.
@end defopt
+@deffn Command lock-file-mode
+This command, called interactively, toggles the local value of
+@code{create-lockfiles} in the current buffer.
+@end deffn
+
@node Information about Files
@section Information about Files
@cindex file, information about
If the 'EMACS_TEST_VERBOSE' environment variable is set, failure
summaries will include the failing condition.
+** File Locks
+
++++
+*** New user option 'lock-file-name-transforms'.
+This option allows controlling where lock files are written. It uses
+the same syntax as 'auto-save-file-name-transforms'.
+
++++
+*** New user option 'remote-file-name-inhibit-locks'.
+When non-nil, this option suppresses lock files for remote files.
+
++++
+*** New minor mode 'lock-file-mode'.
+This command, called interactively, toggles the local value of
+'create-lockfiles' in the current buffer.
+
** Miscellaneous
---
This is like 'insert-buffer-substring', but works in the opposite
direction.
-+++
-*** New user option 'lock-file-name-transforms'.
-This option allows controlling where lock files are written. It uses
-the same syntax as 'auto-save-file-name-transforms'.
-
-+++
-*** New user option 'remote-file-name-inhibit-locks'.
-When non-nil, this option suppresses lock files for remote files.
-
+++
*** New user option 'kill-transform-function'.
This can be used to transform (and suppress) strings from entering the
:initialize 'custom-initialize-delay
:version "21.1")
-(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' (which see), but instead of
-applying to auto-save file names, it's applied to lock file names.
-
-By default, a lock file is put into the same directory as the
-file it's locking, and it has the same name, but with \".#\" prepended."
- :group 'files
- :type '(repeat (list (regexp :tag "Regexp")
- (string :tag "Replacement")
- (boolean :tag "Uniquify")))
- :version "28.1")
-
-(defcustom remote-file-name-inhibit-locks nil
- "Whether to use file locks for remote files."
- :group 'files
- :version "28.1"
- :type 'boolean)
-
(defvar auto-save--timer nil "Timer for `auto-save-visited-mode'.")
(defcustom auto-save-visited-interval 5
:type '(choice (const t) (const nil) (const silently))
:group 'abbrev)
+(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' (which see), but instead of
+applying to auto-save file names, it's applied to lock file names.
+
+By default, a lock file is put into the same directory as the
+file it's locking, and it has the same name, but with \".#\" prepended."
+ :group 'files
+ :type '(repeat (list (regexp :tag "Regexp")
+ (string :tag "Replacement")
+ (boolean :tag "Uniquify")))
+ :initialize 'custom-initialize-delay
+ :version "28.1")
+
+(defcustom remote-file-name-inhibit-locks nil
+ "Whether to use file locks for remote files."
+ :group 'files
+ :version "28.1"
+ :type 'boolean)
+
+(define-minor-mode lock-file-mode
+ "Toggle file locking in the current buffer (Lock File mode)."
+ :version "28.1"
+ (setq-local create-lockfiles (and lock-file-mode t)))
+
(defcustom find-file-run-dired t
"Non-nil means allow `find-file' to visit directories.
To visit the directory, `find-file' runs `find-directory-functions'."