emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/marginalia 5573318a0e 2/2: Minor simplification


From: ELPA Syncer
Subject: [elpa] externals/marginalia 5573318a0e 2/2: Minor simplification
Date: Thu, 13 Jan 2022 17:57:41 -0500 (EST)

branch: externals/marginalia
commit 5573318a0e95d49c676a022cb68aaad095aa0c76
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Minor simplification
---
 marginalia.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index a8a79eedfe..d32e2f54c3 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -912,13 +912,11 @@ These annotations are skipped for remote paths."
 ;; Taken from `seconds-to-string'.
 (defun marginalia--time-relative (time)
   "Format TIME as a relative age."
-  (setq time (float-time (time-since time)))
-  (if (<= time 0)
-      "0 secs ago"
-    (let ((sts marginalia--time-relative) here)
-      (while (and (car (setq here (pop sts))) (<= (car here) time)))
-      (setq time (round time (caddr here)))
-      (format "%s %s%s ago" time (cadr here) (if (= time 1) "" "s")))))
+  (setq time (max 0 (float-time (time-since time))))
+  (let ((sts marginalia--time-relative) here)
+    (while (and (car (setq here (pop sts))) (<= (car here) time)))
+    (setq time (round time (caddr here)))
+    (format "%s %s%s ago" time (cadr here) (if (= time 1) "" "s"))))
 
 (defun marginalia--time-absolute (time)
   "Format TIME as an absolute age."



reply via email to

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