aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPaul Eggert2013-07-09 23:26:23 -0700
committerPaul Eggert2013-07-09 23:26:23 -0700
commit954b166e9037de5fdd43b4fbe7b8c73a36ac402e (patch)
tree4a1aa065be1ec87b53fdaff13f1129863ba2ebb5 /lisp
parent56973319b58a66e97ae45e050f9f943ff8f1439b (diff)
downloademacs-954b166e9037de5fdd43b4fbe7b8c73a36ac402e.tar.gz
emacs-954b166e9037de5fdd43b4fbe7b8c73a36ac402e.zip
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
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/files.el5
2 files changed, 10 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3b7d95837b0..91ce836617c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-07-10 Paul Eggert <eggert@cs.ucla.edu>
2
3 Timestamp fixes for undo (Bug#14824).
4 * files.el (clear-visited-file-modtime): Move here from fileio.c.
5
12013-07-10 Leo Liu <sdl.web@gmail.com> 62013-07-10 Leo Liu <sdl.web@gmail.com>
2 7
3 * files.el (require-final-newline): Allow safe local value. 8 * files.el (require-final-newline): Allow safe local value.
diff --git a/lisp/files.el b/lisp/files.el
index a8ccf81fa17..26f229ec981 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4918,6 +4918,11 @@ change the additional actions you can take on files."
4918 (length autosaved-buffers) 4918 (length autosaved-buffers)
4919 (mapconcat 'identity autosaved-buffers ", ")))))))) 4919 (mapconcat 'identity autosaved-buffers ", "))))))))
4920 4920
4921(defun clear-visited-file-modtime ()
4922 "Clear out records of last mod time of visited file.
4923Next attempt to save will certainly not complain of a discrepancy."
4924 (set-visited-file-modtime 0))
4925
4921(defun not-modified (&optional arg) 4926(defun not-modified (&optional arg)
4922 "Mark current buffer as unmodified, not needing to be saved. 4927 "Mark current buffer as unmodified, not needing to be saved.
4923With prefix ARG, mark buffer as modified, so \\[save-buffer] will save. 4928With prefix ARG, mark buffer as modified, so \\[save-buffer] will save.