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

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

[elpa] externals/activities 05d8dbcdc1 07/50: Use struct-slot-value inst


From: ELPA Syncer
Subject: [elpa] externals/activities 05d8dbcdc1 07/50: Use struct-slot-value instead of rolling our own function
Date: Wed, 25 Dec 2024 03:57:17 -0500 (EST)

branch: externals/activities
commit 05d8dbcdc157706371161b852779c47af1eae6e2
Author: J.D. Smith <jdtsmith@gmail.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>

    Use struct-slot-value instead of rolling our own function
---
 activities.el | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/activities.el b/activities.el
index 2b51a403bb..2a608ea318 100644
--- a/activities.el
+++ b/activities.el
@@ -850,11 +850,9 @@ Adapted from `magit--age'."
   (cl-loop for (_name . act) in activities maximize
           (cl-loop
            for type in '(default last)
-           for func = (intern (format "activities-activity-%s" type))
-           maximize
-           (float-time
-            (time-since
-             (map-elt (activities-activity-state-etc (funcall func act)) 
'time))))))
+           for state = (cl-struct-slot-value 'activities-activity type act)
+           for etc = (activities-activity-state-etc state)
+           maximize (float-time (time-since (map-elt etc 'time))))))
 
 (defun activities-annotate (max-age oldest-possible)
   "Return an activity annotation function.
@@ -864,8 +862,7 @@ OLDEST-POSSIBLE is the oldest age in the 
`vc-annotate-color-map'."
     (when-let ((activity (map-elt activities-activities name)))
       (let (data (age-len 14))
        (dolist (type '(last default))
-         (let* ((func (intern (format "activities-activity-%s" type)))
-                (state (funcall func activity))
+         (let* ((state (cl-struct-slot-value 'activities-activity type 
activity))
                 (time (map-elt (activities-activity-state-etc state) 'time))
                 (window-state (activities-activity-state-window-state state))
                 (buffers (window-state-buffers window-state))



reply via email to

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