branch: elpa/magit commit 58fa12214798db1a37db0e4850c7d919b92500d6 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Use named-let instead of cl-labels --- lisp/magit-diff.el | 11 +++++------ lisp/magit-margin.el | 27 +++++++++++++-------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 9a69e68e8cf..86f4b424c83 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 e8e749d4e1d..a85578ad670 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)