Variable: file-precious-flag

file-precious-flag is a customizable variable defined in files.el.gz.

Value

nil

Documentation

Non-nil means protect against I/O errors while saving files.

Some modes set this non-nil in particular buffers.

This feature works by writing the new contents into a temporary file and then renaming the temporary file to replace the original. In this way, any I/O error in writing leaves the original untouched, and there is never any instant where the file is nonexistent.

Note that this feature forces backups to be made by copying. Yet, at the same time, saving a precious file breaks any hard links between it and other files.

This feature is advisory: for example, if the directory in which the file is being saved is not writable, Emacs may ignore a non-nil value of file-precious-flag and write directly into the file.

See also: break-hardlink-on-save and file-preserve-symlinks-on-save.

View in manual

Probably introduced at or before Emacs version 18.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defcustom file-precious-flag nil
  "Non-nil means protect against I/O errors while saving files.
Some modes set this non-nil in particular buffers.

This feature works by writing the new contents into a temporary file
and then renaming the temporary file to replace the original.
In this way, any I/O error in writing leaves the original untouched,
and there is never any instant where the file is nonexistent.

Note that this feature forces backups to be made by copying.
Yet, at the same time, saving a precious file
breaks any hard links between it and other files.

This feature is advisory: for example, if the directory in which the
file is being saved is not writable, Emacs may ignore a non-nil value
of `file-precious-flag' and write directly into the file.

See also: `break-hardlink-on-save' and `file-preserve-symlinks-on-save'."
  :type 'boolean
  :group 'backup)