Suppose that you visit a file and make changes in its buffer, and meanwhile the file itself is changed on disk. At this point, saving the buffer would overwrite the changes in the file. Occasionally this may be what you want, but usually it would lose valuable information. Emacs therefore checks the file's modification time using the functions described below before saving the file.
The function returns t
if the last actual modification time and
Emacs's recorded modification time are the same, nil
otherwise.
This function is called in set-visited-file-name
and other
exceptional places where the usual test to avoid overwriting a changed
file should not be done.
(high . low)
. (This is the
same format that file-attributes
uses to return time values; see
section Other Information about Files.)
nil
, and otherwise to the last modification time of the
visited file.
If time is not nil
, it should have the form
(high . low)
or (high low)
, in
either case containing two integers, each of which holds 16 bits of the
time.
This function is useful if the buffer was not read from the file normally, or if the file itself has been changed for some known benign reason.
Depending on the user's answer, the function may return normally, in
which case the modification of the buffer proceeds, or it may signal a
file-supersession
error with data (filename)
, in which
case the proposed buffer modification is not allowed.
This function is called automatically by Emacs on the proper occasions. It exists so you can customize Emacs by redefining it. See the file `userlock.el' for the standard definition.
See also the file locking mechanism in section File Locks.
Go to the first, previous, next, last section, table of contents.