diff options
| author | Stefan Monnier | 2010-04-12 21:47:40 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-04-12 21:47:40 -0400 |
| commit | 58b963f7f3d9d8e869408666608c05f3c69a5cb5 (patch) | |
| tree | 40dfbee49634c6d8b0ffd38ef1b5db86a7544ff8 /src/buffer.h | |
| parent | 5b31b787b743ecc6d2e7454a57deaf12ca312f01 (diff) | |
| download | emacs-58b963f7f3d9d8e869408666608c05f3c69a5cb5.tar.gz emacs-58b963f7f3d9d8e869408666608c05f3c69a5cb5.zip | |
Try to detect file modification within the same second.
* buffer.h (struct buffer): New field modtime_size.
* buffer.c (reset_buffer): Initialize it.
* fileio.c (Finsert_file_contents, Fwrite_region): Set it.
(Fverify_visited_file_modtime): Check it.
(Fclear_visited_file_modtime, Fset_visited_file_modtime): Clear it.
(Fset_visited_file_modtime): Set (or clear) it.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 40f03daca90..fa3fc6dafb8 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -513,6 +513,12 @@ struct buffer | |||
| 513 | 0 means visited file modtime unknown; in no case complain | 513 | 0 means visited file modtime unknown; in no case complain |
| 514 | about any mismatch on next save attempt. */ | 514 | about any mismatch on next save attempt. */ |
| 515 | int modtime; | 515 | int modtime; |
| 516 | /* Size of the file when modtime was set. This is used to detect the | ||
| 517 | case where the file grew while we were reading it, so the modtime | ||
| 518 | is still the same (since it's rounded up to seconds) but we're actually | ||
| 519 | not up-to-date. -1 means the size is unknown. Only meaningful if | ||
| 520 | modtime is actually set. */ | ||
| 521 | EMACS_INT modtime_size; | ||
| 516 | /* The value of text->modiff at the last auto-save. */ | 522 | /* The value of text->modiff at the last auto-save. */ |
| 517 | int auto_save_modified; | 523 | int auto_save_modified; |
| 518 | /* The value of text->modiff at the last display error. | 524 | /* The value of text->modiff at the last display error. |