[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep 0e19d4c981 3/4: Don't use `cl-loop`
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/urgrep 0e19d4c981 3/4: Don't use `cl-loop` |
|
Date: |
Fri, 10 Nov 2023 18:58:52 -0500 (EST) |
branch: externals/urgrep
commit 0e19d4c9812e73cfb0c9f3b1594d17b7bc4a020c
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Don't use `cl-loop`
---
urgrep.el | 59 +++++++++++++++++++++++++++++------------------------------
1 file changed, 29 insertions(+), 30 deletions(-)
diff --git a/urgrep.el b/urgrep.el
index f6e9f68bda..88251b82b8 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -224,8 +224,7 @@ properties defined in the `urgrep-tools' entry for TOOL."
(cons k (urgrep--get-prop-pcase
k tool v "-arguments")))
props))))
- (urgrep--flatten-arguments (cl-sublis props arguments)
- abbrev)))
+ (urgrep--flatten-arguments (cl-sublis props arguments) abbrev)))
(rx-define urgrep-regular-number (seq (any "1-9") (* digit)))
@@ -529,34 +528,34 @@ This caches the default tool per-host in
`urgrep--host-defaults'."
vc-backend-name)
(if (and urgrep--cached-tool use-cache)
urgrep--cached-tool
- (cl-loop
- for tool iter-by (urgrep--iter-tools) do
- (let ((tool-executable (urgrep--get-prop 'executable-name tool))
- (tool-vc-backend (urgrep--get-prop 'vc-backend tool)))
- ;; If we see a VC-specific tool, this host might use different tools
- ;; for different directories, so we can't cache anything.
- (setq use-cache (and use-cache (not tool-vc-backend)))
- ;; Cache the VC backend name if we need it.
- (when-let (((and tool-vc-backend (not vc-backend-name)))
- (proj (project-current)))
- (setq vc-backend-name (vc-responsible-backend
- (project-root proj))))
- ;; If we find the executable (and it's for the right VC backend, if
- ;; relevant), cache it if possible and then return it.
- (when (and (seq-every-p (lambda (i) (executable-find i t))
- (ensure-list tool-executable))
- (or (not tool-vc-backend)
- (string= vc-backend-name tool-vc-backend)))
- (when use-cache
- (setq urgrep--cached-tool tool)
- (when (file-remote-p default-directory)
- (connection-local-set-profile-variables
- (urgrep-connection-local-profile)
- `((urgrep--cached-tool . ,urgrep--cached-tool)))
- (connection-local-set-profiles
- (connection-local-criteria-for-default-directory)
- (urgrep-connection-local-profile))))
- (cl-return tool))))))))
+ (catch 'found
+ (iter-do (tool (urgrep--iter-tools))
+ (let ((tool-executable (urgrep--get-prop 'executable-name tool))
+ (tool-vc-backend (urgrep--get-prop 'vc-backend tool)))
+ ;; If we see a VC-specific tool, this host might use different
+ ;; tools for different directories, so we can't cache anything.
+ (setq use-cache (and use-cache (not tool-vc-backend)))
+ ;; Cache the VC backend name if we need it.
+ (when-let (((and tool-vc-backend (not vc-backend-name)))
+ (proj (project-current)))
+ (setq vc-backend-name (vc-responsible-backend
+ (project-root proj))))
+ ;; If we find the executable (and it's for the right VC backend,
if
+ ;; relevant), cache it if possible and then return it.
+ (when (and (seq-every-p (lambda (i) (executable-find i t))
+ (ensure-list tool-executable))
+ (or (not tool-vc-backend)
+ (string= vc-backend-name tool-vc-backend)))
+ (when use-cache
+ (setq urgrep--cached-tool tool)
+ (when (file-remote-p default-directory)
+ (connection-local-set-profile-variables
+ (urgrep-connection-local-profile)
+ `((urgrep--cached-tool . ,urgrep--cached-tool)))
+ (connection-local-set-profiles
+ (connection-local-criteria-for-default-directory)
+ (urgrep-connection-local-profile))))
+ (throw 'found tool)))))))))
(defun urgrep-get-tool (&optional tool)
"Get the urgrep tool for TOOL.