diff options
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r-- | lisp/ls-lisp.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 280e7f4bc3e..caddc7f760b 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -567,6 +567,8 @@ Responds to the window width as ls should but may not!" (setq list (cdr list))) result)) +(defvar w32-collate-ignore-punctuation) ; Declare for non-w32 builds. + (defsubst ls-lisp-string-lessp (s1 s2) "Return t if string S1 should sort before string S2. Case is significant if `ls-lisp-ignore-case' is nil. @@ -861,7 +863,7 @@ Use the same method as ls to decide whether to show time-of-day or year, depending on distance between file date and the current time. All ls time options, namely c, t and u, are handled." (let* ((time (nth (or time-index 5) file-attr)) ; default is last modtime - (diff (- (float-time time) (float-time))) + (diff (time-subtract time nil)) ;; Consider a time to be recent if it is within the past six ;; months. A Gregorian year has 365.2425 * 24 * 60 * 60 == ;; 31556952 seconds on the average, and half of that is 15778476. @@ -878,7 +880,8 @@ All ls time options, namely c, t and u, are handled." (if (member locale '("C" "POSIX")) (setq locale nil)) (format-time-string - (if (and (<= past-cutoff diff) (<= diff 0)) + (if (and (not (time-less-p diff past-cutoff)) + (not (time-less-p 0 diff))) (if (and locale (not ls-lisp-use-localized-time-format)) "%m-%d %H:%M" (nth 0 ls-lisp-format-time-list)) |