[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep 53d72fe09c 023/115: Don't cache tool results for
From: |
ELPA Syncer |
Subject: |
[elpa] externals/urgrep 53d72fe09c 023/115: Don't cache tool results for hosts which can use VC-specific tools |
Date: |
Wed, 10 May 2023 03:00:39 -0400 (EDT) |
branch: externals/urgrep
commit 53d72fe09c28ed8fe1495e604a2ab002601c948d
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Don't cache tool results for hosts which can use VC-specific tools
---
urgrep.el | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/urgrep.el b/urgrep.el
index e08ccd94fb..dfe2200a54 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -148,7 +148,7 @@ or a list of tool names to try in descending order of
preference."
urgrep-tools))))
:group 'urgrep)
-(defvar urgrep--host-defaults '()
+(defvar urgrep--host-defaults nil
"Default urgrep values for each known host.
This is an alist of host symbols (`localhost' or a TRAMP host) and
the default tool to use on that host.")
@@ -170,11 +170,13 @@ This caches the default tool per-host in
`urgrep--host-defaults'."
(if-let ((host-id (intern (or (file-remote-p default-directory)
"localhost")))
(cached-tool-name (alist-get host-id urgrep--host-defaults)))
(assoc cached-tool-name urgrep-tools)
- (let ((vc-backend-name))
+ (let ((vc-backend-name)
+ (saw-vc-tool-p nil))
(cl-dolist (tool (or urgrep-preferred-tools urgrep-tools))
(let* ((tool (if (stringp tool) (assoc tool urgrep-tools) tool))
(tool-executable (urgrep-get-property tool 'executable-name))
(tool-vc-backend (urgrep-get-property tool 'vc-backend)))
+ (setq saw-vc-tool-p (or saw-vc-tool-p 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)))
@@ -184,7 +186,13 @@ This caches the default tool per-host in
`urgrep--host-defaults'."
(when (and (executable-find tool-executable t)
(or (not tool-vc-backend)
(string= vc-backend-name tool-vc-backend)))
- (add-to-list 'urgrep--host-defaults (cons host-id (car tool)))
+ ;; So long as we didn't examine a VC-specific tool, we can cache
+ ;; this result for future calls, since the result will always be
the
+ ;; same. If we *did* see a VC-specific tool, this host will use
+ ;; different tools for different directories, so we can't cache
+ ;; anything.
+ (unless saw-vc-tool-p
+ (add-to-list 'urgrep--host-defaults (cons host-id (car tool))))
(cl-return tool)))))))
(defun urgrep-get-tool (&optional tool)
- [elpa] branch externals/urgrep created (now 7823d384e6), ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep ccd6fe0d4c 002/115: Add a basic keymap, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 8832dc103f 003/115: Add support for find/grep by delegating to Emacs' built-in `rgrep', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 133d308eec 004/115: Don't add `-face' to face names, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 4ec9d9febd 010/115: Fix behavior of temporarily overriding `urgrep-search-regexp', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 7780887977 005/115: Add initial support for git grep, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep d965e6b848 007/115: Add the ability to toggle regexp mode when entering a search, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 764742fd14 006/115: Recurse submodules with git grep, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 6d9217c344 013/115: Rename urgrep-test.el to urgrep-tests.el, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep aba02cc3f9 017/115: Add support for ripgrep and ack, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 53d72fe09c 023/115: Don't cache tool results for hosts which can use VC-specific tools,
ELPA Syncer <=
- [elpa] externals/urgrep 266965a0a2 024/115: Add support for intelligent editing of previous search commands, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 350d6d1889 027/115: Add support for regexp-syntax and context with the grep backend, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 887114113c 001/115: Initial revision, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep b578b0f857 009/115: Add a README and more-detailed docstrings, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 026c54d11e 012/115: Add support for setting context, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep ca67ad1f4d 030/115: Use isearch-like bindings in the urgrep minibuffer, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 8bb469a526 036/115: Add some details about our buffer-local variables, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 9ff22a4481 041/115: Minor fixes to defcustoms, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep c879c02558 040/115: Add some docs and clean up spacing, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 5b792fe0de 045/115: Use symbols instead of strings for `urgrep-tools' keys, ELPA Syncer, 2023/05/10