[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep b03a3d84ec 098/115: Add `suffix` argument to `ur
From: |
ELPA Syncer |
Subject: |
[elpa] externals/urgrep b03a3d84ec 098/115: Add `suffix` argument to `urgrep--get-prop(-pcase)?` |
Date: |
Wed, 10 May 2023 03:00:48 -0400 (EDT) |
branch: externals/urgrep
commit b03a3d84ecbcdc50225b1fa3b0b8dee88bc19edc
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Add `suffix` argument to `urgrep--get-prop(-pcase)?`
---
urgrep.el | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/urgrep.el b/urgrep.el
index 538b474efa..b50c1df103 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -197,10 +197,10 @@ as in `urgrep-command'."
(let ((grep-find-template grep-find-template)
(grep-highlight-matches (if color 'always nil))
(files (if files (mapconcat #'identity files " ") "*")))
- (pcase-dolist (`(,k . ,v) `((regexp-arguments . ,regexp)
- (case-fold-arguments . ,case-fold)
- (context-arguments . ,context)))
- (when-let ((args (urgrep--get-prop-pcase k tool v))
+ (pcase-dolist (`(,k . ,v) `((regexp . ,regexp)
+ (case-fold . ,case-fold)
+ (context . ,context)))
+ (when-let ((args (urgrep--get-prop-pcase k tool v "-arguments"))
(args (mapconcat #'urgrep--maybe-shell-quote-argument args
" "))
((string-match "<C>" grep-find-template)))
@@ -363,13 +363,17 @@ This value is connection-local.")
(intern (concat "urgrep-connection-local-profile-"
(or (file-remote-p default-directory) "local"))))
-(defun urgrep--get-prop (prop tool)
- "Get the property PROP from TOOL, or nil if PROP is undefined."
+(defun urgrep--get-prop (prop tool &optional suffix)
+ "Get the property PROP from TOOL, or nil if PROP is undefined.
+If SUFFIX is non-nil, append it to PROP to generate the property name."
+ (when suffix
+ (setq prop (intern (concat (symbol-name prop) suffix))))
(alist-get prop (cdr tool)))
-(defun urgrep--get-prop-pcase (prop tool value)
- "Get the property PROP from TOOL and use it as a `pcase' macro for VALUE."
- (when-let ((cases (urgrep--get-prop prop tool))
+(defun urgrep--get-prop-pcase (prop tool value &optional suffix)
+ "Get the property PROP from TOOL and use it as a `pcase' macro for VALUE.
+If SUFFIX is non-nil, append it to PROP to generate the property name."
+ (when-let ((cases (urgrep--get-prop prop tool suffix))
(block (append `(,#'pcase ',value) cases)))
(eval block t)))
@@ -517,8 +521,7 @@ DIRECTORY: the directory to search in, or nil to use the
(group . ,group)
(context . ,context)
(color . ,color)))
- (let* ((prop (intern (concat (symbol-name k) "-arguments")))
- (args (urgrep--get-prop-pcase prop tool v)))
+ (let ((args (urgrep--get-prop-pcase k tool v "-arguments")))
(setq arguments (cl-substitute args k arguments))))
(setq arguments (flatten-list arguments))
(mapconcat #'urgrep--maybe-shell-quote-argument arguments " ")))))))
- [elpa] externals/urgrep 0de93bfdb9 068/115: Fix use of wgrep on long urgrep results, (continued)
- [elpa] externals/urgrep 0de93bfdb9 068/115: Fix use of wgrep on long urgrep results, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep e2e8898ab2 074/115: Update copyright, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 0c966b2001 075/115: Ensure `default-directory' stays in sync, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep c15be33112 076/115: Wrap shell argument quoting with `with-connection-local-variables`, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep e63c6c5173 089/115: Add link to wgrep package and clarify the README, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 61478da305 077/115: Improve reliability of running urgrep over Tramp, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 77fcfc1916 090/115: Use `push` instead of `add-to-list`, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 559b2c07cd 091/115: Add a unit test for getting the preferred tool on multiple hosts, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep fe13a3cbb5 081/115: Fix project-root call on Emacs 27, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep f2c87e7520 080/115: Improve robustness of tests for grep command generation, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep b03a3d84ec 098/115: Add `suffix` argument to `urgrep--get-prop(-pcase)?`,
ELPA Syncer <=
- [elpa] externals/urgrep eb5191bfd5 097/115: Update copyright year, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 43c82e84ec 082/115: Add CI for Emacs 27.1, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 3082d89bd9 099/115: Add support for abbreviating the command in urgrep buffers, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep b5b426e9ca 084/115: Fix hiding excessive part of rgrep command in Emacs 28, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 56acdfe434 087/115: Improve how we wait for urgrep to finish in tests, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 30cc9e363e 085/115: Fix context-line detection for find/grep, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 0b036cdcf4 100/115: Improve explanation of `C-u C-u` for choosing directory, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 6614dfe651 102/115: Update checkout action in CI, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 01fbe92f2c 103/115: In tests, wait for grep to finish before doing any checks, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 99e1de4eb1 105/115: Fix an edge case when unable to get the grouped filename for highlighting, ELPA Syncer, 2023/05/10