aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-09-13 21:38:49 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-09-13 21:38:49 +0200
commit58fa12214798db1a37db0e4850c7d919b92500d6 (patch)
tree19ff089627ec1cf73767d953305528359ad6d0ea /lisp
parent1f895f1326ba93e65e3533fb910c3e6bcae2dcc4 (diff)
Use named-let instead of cl-labels
Diffstat (limited to 'lisp')
-rw-r--r--lisp/magit-diff.el11
-rw-r--r--lisp/magit-margin.el27
2 files changed, 18 insertions, 20 deletions
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 9a69e68..86f4b42 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -3486,12 +3486,11 @@ actually a `diff' but a `diffstat' section."
(remove-overlays (oref section start)
(oref section end)
'diff-mode 'fine))))
- (cl-labels ((recurse (section)
- (if (magit-section-match 'hunk section)
- (magit-diff-update-hunk-refinement section t)
- (dolist (child (oref section children))
- (recurse child)))))
- (recurse magit-root-section))))
+ (named-let update ((section magit-root-section))
+ (if (magit-section-match 'hunk section)
+ (magit-diff-update-hunk-refinement section t)
+ (dolist (child (oref section children))
+ (update child))))))
;;; Hunk Region
diff --git a/lisp/magit-margin.el b/lisp/magit-margin.el
index e8e749d..a85578a 100644
--- a/lisp/magit-margin.el
+++ b/lisp/magit-margin.el
@@ -241,20 +241,19 @@ as an option, because most other parts of Magit are always in
English.")
(defun magit--age (date &optional abbreviate)
- (cl-labels ((fn (age spec)
- (pcase-let ((`(,char ,unit ,units ,weight) (car spec)))
- (let ((cnt (round (/ age weight 1.0))))
- (if (or (not (cdr spec))
- (>= (/ age weight) 1))
- (list cnt (cond (abbreviate char)
- ((= cnt 1) unit)
- (units)))
- (fn age (cdr spec)))))))
- (fn (abs (- (float-time)
- (if (stringp date)
- (string-to-number date)
- date)))
- magit--age-spec)))
+ (named-let calc ((age (abs (- (float-time)
+ (if (stringp date)
+ (string-to-number date)
+ date))))
+ (spec magit--age-spec))
+ (pcase-let ((`(,char ,unit ,units ,weight) (car spec)))
+ (let ((cnt (round (/ age weight 1.0))))
+ (if (or (not (cdr spec))
+ (>= (/ age weight) 1))
+ (list cnt (cond (abbreviate char)
+ ((= cnt 1) unit)
+ (units)))
+ (calc age (cdr spec)))))))
;;; _
(provide 'magit-margin)