From 954b166e9037de5fdd43b4fbe7b8c73a36ac402e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 9 Jul 2013 23:26:23 -0700 Subject: Timestamp fixes for undo. * doc/lispref/text.texi (Undo): Document (t . 0) and (t . -1) in buffer-undo-list. * etc/NEWS: Changes to visited-file-modtime, set-visited-file-modtime. * lisp/files.el (clear-visited-file-modtime): Move here from fileio.c. * src/atimer.c (schedule_atimer): * src/fileio.c (Ffile_newer_than_file_p): Minor cleanup: use EMACS_TIME_LT so that we can remove EMACS_TIME_GT. * src/buffer.c (buffer-undo-list): Document (t . 0) and (t . -1). * src/fileio.c (Fclear_visited_file_modtime): Move to lisp/files.el. (syms_of_fileio): Remove Sclear_visited_file_name. (Fvisited_file_modtime): Return -1, not (-1 ...), when the visited file doesn't exist; this avoids an ambiguity with negative timestamps. (Fset_visited_file_modtime): Accept -1 and 0 as time-list arg. * src/systime.h (make_emacs_time, invalid_emacs_time): Don't assume struct timespec layout; POSIX doesn't guarantee it. (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE): Remove. * src/undo.c (record_first_change): Push (visited-file-modtime) onto undo list rather than reimplementing it by hand, incorrectly. Fixes: debbugs:14824 --- src/buffer.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/buffer.c') diff --git a/src/buffer.c b/src/buffer.c index 94104ef535c..81768849a4b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -6095,6 +6095,11 @@ and is the visited file's modification time, as of that time. If the modification time of the most recent save is different, this entry is obsolete. +An entry (t . 0) means means the buffer was previously unmodified but +its time stamp was unknown because it was not associated with a file. +An entry (t . -1) is similar, except that it means the buffer's visited +file did not exist. + An entry (nil PROPERTY VALUE BEG . END) indicates that a text property was modified between BEG and END. PROPERTY is the property name, and VALUE is the old value. -- cgit v1.2.1