From 0c93aa38b3f5333d7b026e6cc1e0c9d313a4da71 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 17 Nov 2012 18:13:19 -0800 Subject: [PATCH] Minor cleanup for times as lists of four integers. * doc/lispref/os.texi (Time Parsing): Time values can now be four integers. * lisp/files.el (dir-locals-directory-cache): * lisp/ps-bdf.el (bdf-file-mod-time, bdf-read-font-info): Doc fixes. * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls): * lisp/ps-bdf.el (bdf-file-newer-than-time): Process four-integers time stamps, not two. Doc fixes. --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/os.texi | 4 ++-- lisp/ChangeLog | 10 ++++++++++ lisp/files.el | 2 +- lisp/net/tramp-sh.el | 7 +++---- lisp/ps-bdf.el | 19 +++++++------------ 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 43ca9ac4aa5..389d94bf8c5 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-11-18 Paul Eggert + + Minor cleanup for times as lists of four integers. + * os.texi (Time Parsing): Time values can now be four integers. + 2012-11-18 Glenn Morris * loading.texi (How Programs Do Loading): Add eager macro expansion. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 6c5f6e85683..002632c3479 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1373,8 +1373,8 @@ on others, years as early as 1901 do work. @node Time Parsing @section Parsing and Formatting Times - These functions convert time values (lists of two or three integers) -to text in a string, and vice versa. + These functions convert time values to text in a string, and vice versa. +Time values are lists of two to four integers (@pxref{Time of Day}). @defun date-to-time string This function parses the time-string @var{string} and returns the diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 00cf0c1afb6..920f893bb7d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2012-11-18 Paul Eggert + + Minor cleanup for times as lists of four integers. + * files.el (dir-locals-directory-cache): + * ps-bdf.el (bdf-file-mod-time, bdf-read-font-info): + Doc fixes. + * net/tramp-sh.el (tramp-do-file-attributes-with-ls): + * ps-bdf.el (bdf-file-newer-than-time): + Process four-integers time stamps, not two. Doc fixes. + 2012-11-18 Glenn Morris * image.el (insert-image, insert-sliced-image): Doc fix. diff --git a/lisp/files.el b/lisp/files.el index 26c5c683b3d..51f8256f71a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3424,7 +3424,7 @@ DIR is the name of the directory. CLASS is the name of a variable class (a symbol). MTIME is the recorded modification time of the directory-local variables file associated with this entry. This time is a list -of two integers (the same format as `file-attributes'), and is +of integers (the same format as `file-attributes'), and is used to test whether the cache entry is still valid. Alternatively, MTIME can be nil, which means the entry is always considered valid.") diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index ec321d00506..5b090047f8d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1270,12 +1270,11 @@ target of the symlink differ." res-uid ;; 3. File gid. res-gid - ;; 4. Last access time, as a list of two integers. First - ;; integer has high-order 16 bits of time, second has low 16 - ;; bits. + ;; 4. Last access time, as a list of integers in the same format + ;; as `current-time'. ;; 5. Last modification time, likewise. ;; 6. Last status change time, likewise. - '(0 0) '(0 0) '(0 0) ;CCC how to find out? + '(0 0 0 0) '(0 0 0 0) '(0 0 0 0) ;CCC how to find out? ;; 7. Size in bytes (-1, if number is out of range). res-size ;; 8. File modes, as a string of ten letters or dashes as in ls -l. diff --git a/lisp/ps-bdf.el b/lisp/ps-bdf.el index a82e03ceda7..477aee1b2da 100644 --- a/lisp/ps-bdf.el +++ b/lisp/ps-bdf.el @@ -70,20 +70,15 @@ for BDFNAME." (defsubst bdf-file-mod-time (filename) "Return modification time of FILENAME. -The value is a list of two integers, the first integer has high-order -16 bits, the second has low 16 bits." +The value is a list of integers in the same format as `current-time'." (nth 5 (file-attributes filename))) (defun bdf-file-newer-than-time (filename mod-time) "Return non-nil if and only if FILENAME is newer than MOD-TIME. -MOD-TIME is a modification time as a list of two integers, the first -integer has high-order 16 bits, the second has low 16 bits." - (let* ((new-mod-time (bdf-file-mod-time filename)) - (new-time (car new-mod-time)) - (time (car mod-time))) - (or (> new-time time) - (and (= new-time time) - (> (nth 1 new-mod-time) (nth 1 mod-time)))))) +MOD-TIME is a modification time as a list of integers in the same +format as `current-time'." + (let ((new-mod-time (bdf-file-mod-time filename))) + (time-less-p mod-time new-mod-time))) (defun bdf-find-file (bdfname) "Return a buffer visiting a bdf file BDFNAME. @@ -178,8 +173,8 @@ FONT-INFO is a list of the following format: (BDFFILE MOD-TIME FONT-BOUNDING-BOX RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR) -MOD-TIME is last modification time as a list of two integers, the -first integer has high-order 16 bits, the second has low 16 bits. +MOD-TIME is last modification time as a list of integers in the +same format as `current-time'. SIZE is a size of the font on 72 dpi device. This value is got from SIZE record of the font. -- 2.39.2