emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9b49afd 2/4: Use decoded-time accessors in esh-util


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 9b49afd 2/4: Use decoded-time accessors in esh-util
Date: Thu, 1 Aug 2019 07:48:44 -0400 (EDT)

branch: master
commit 9b49afd287f4220d8a3e3ecbf83f3f0dc3745a0a
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Use decoded-time accessors in esh-util
    
    * lisp/eshell/esh-util.el (eshell-parse-ange-ls): Use decoded-time
    accessors for results from `parse-time-string'.
---
 lisp/eshell/esh-util.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 0824031..353b940 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -647,12 +647,12 @@ If NOSORT is non-nil, the list is not sorted--its order 
is unpredictable.
               (name (ange-ftp-parse-filename))
               (mtime
                (let ((moment (parse-time-string (match-string 6))))
-                 (if (nth 0 moment)
-                     (setcar (nthcdr 5 moment)
-                             (decoded-time-year (decode-time)))
-                   (setcar (nthcdr 0 moment) 0)
-                   (setcar (nthcdr 1 moment) 0)
-                   (setcar (nthcdr 2 moment) 0))
+                 (if (decoded-time-second moment)
+                     (setf (decoded-time-year moment)
+                           (decoded-time-year (decode-time)))
+                   (setf (decoded-time-second moment) 0)
+                   (setf (decoded-time-minute moment) 0)
+                    (setf (decoded-time-hour moment) 0))
                  (encode-time moment)))
               symlink)
          (if (string-match "\\(.+\\) -> \\(.+\\)" name)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]