summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2026-05-02 11:50:57 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2026-05-02 11:50:57 +0200
commit8d87d2aedcefe0b157204f5c936dce3d0eacdf27 (patch)
treeb99b0e30cf9dbc5d05c946f599f23a4bc623266a
parent4a0628dfdf944a5d307d31d2a514825cc5386986 (diff)
Require Compat 31externals/marginalia
-rw-r--r--marginalia.el15
1 files changed, 2 insertions, 13 deletions
diff --git a/marginalia.el b/marginalia.el
index 171ebf1..7706db7 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -6,7 +6,7 @@
;; Maintainer: Omar AntolĂ­n Camarena <omar@matem.unam.mx>, Daniel Mendler <mail@daniel-mendler.de>
;; Created: 2020
;; Version: 2.10
-;; Package-Requires: ((emacs "29.1") (compat "30"))
+;; Package-Requires: ((emacs "29.1") (compat "31"))
;; URL: https://github.com/minad/marginalia
;; Keywords: docs, help, matching, completion
@@ -1052,18 +1052,7 @@ These annotations are skipped for remote paths."
(defun marginalia--time-relative (time)
"Format TIME as a relative age."
(setq time (max 0 (float-time (time-since time))))
- ;; TODO Use seconds-to-string ported from Emacs 31 via Compat
- (static-if (>= emacs-major-version 31)
- (concat (seconds-to-string time 'expanded 'abbrev) " ago")
- (let ((sts '((100 "sec" 1)
- (6000 "min" 60.0)
- (108000 "hour" 3600.0)
- (34560000 "day" 86400.0)
- (nil "year" 31557600.0)))
- 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")))))
+ (concat (compat-call seconds-to-string time 'expanded 'abbrev) " ago"))
(defun marginalia--time-absolute (time)
"Format TIME as an absolute age."