[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))
- [elpa] externals/activities 322de07933 35/50: activities--age: rewrite, note future core replacement, (continued)
- [elpa] externals/activities 322de07933 35/50: activities--age: rewrite, note future core replacement, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 425b6199ca 37/50: activities-annotation-colors: simplify doc and use ALPHA, ELPA Syncer, 2024/12/25
- [elpa] externals/activities d648a9e3a9 42/50: README: rename section as Completion, ELPA Syncer, 2024/12/25
- [elpa] externals/activities b69373eda6 43/50: README: simplify Completion description, ELPA Syncer, 2024/12/25
- [elpa] externals/activities b75e6f4ab6 44/50: oldest-age: find oldest age of last OR default state, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 9b792abceb 01/50: Initial annotation support for activities-completing-read, ELPA Syncer, 2024/12/25
- [elpa] externals/activities b07a5370de 02/50: Correct the file count, ELPA Syncer, 2024/12/25
- [elpa] externals/activities e829cf9fa2 03/50: re-org: move oldest-age up, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 1e14be5c59 06/50: simplify annotation-function using pcase-let*, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 61461aec1d 05/50: docs: fix typo in oldest-age, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 05d8dbcdc1 07/50: Use struct-slot-value instead of rolling our own function,
ELPA Syncer <=
- [elpa] externals/activities 10240f31a4 04/50: Find oldest colormap age just once per read, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 8463af4207 12/50: annotate: correct indentation for makem.sh, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 00787671f8 14/50: README: add information about the annotations, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 597bccdbd9 17/50: annotate: indicate active and modified using final flag char, ELPA Syncer, 2024/12/25
- [elpa] externals/activities ea95275d88 19/50: Handle plurals correctly in annotation bufs/files, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 9e46784287 23/50: Remove debug message, ELPA Syncer, 2024/12/25
- [elpa] externals/activities bcf09497de 26/50: README: improve annotation/sorting docs, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 0e7151b6bd 28/50: buffer-and-files-differ: improve docstring, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 8c5efa1855 29/50: buffers-and-files: better var name, ELPA Syncer, 2024/12/25
- [elpa] externals/activities 93e1fbbad0 30/50: map-window-state-leafs -> mapcar-window-state-leafs, ELPA Syncer, 2024/12/25