[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep 582896b5af 050/115: Use dotted pairs for alist f
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/urgrep 582896b5af 050/115: Use dotted pairs for alist for each tool |
|
Date: |
Wed, 10 May 2023 03:00:42 -0400 (EDT) |
branch: externals/urgrep
commit 582896b5af8110f893c0ff869171db3cfa01373e
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Use dotted pairs for alist for each tool
---
urgrep-tests.el | 2 +-
urgrep.el | 141 ++++++++++++++++++++++++++++----------------------------
2 files changed, 71 insertions(+), 72 deletions(-)
diff --git a/urgrep-tests.el b/urgrep-tests.el
index f2518926f5..dd8e94b634 100644
--- a/urgrep-tests.el
+++ b/urgrep-tests.el
@@ -414,7 +414,7 @@
(ert-deftest urgrep-tests-get-tool-cons ()
(cl-letf (((symbol-function #'executable-find) #'always))
(let* ((urgrep--host-defaults)
- (tool (urgrep-get-tool '(goofy (executable-name "gf")))))
+ (tool (urgrep-get-tool '(goofy (executable-name . "gf")))))
(should (equal (car tool) 'goofy))
(should (equal (urgrep--get-prop 'executable-name tool) "gf"))
(should (equal urgrep--host-defaults nil)))))
diff --git a/urgrep.el b/urgrep.el
index 1bc748adf2..d9a561bfba 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -202,89 +202,88 @@ See also `grep-process-setup'."
(defvar urgrep-tools
`((ripgrep
- (executable-name "rg")
- (regexp-syntax (pcre))
- (arguments (executable color file-wildcards group context case-fold regexp
- "--" query))
- (color-arguments (('nil '("--color" "never"))
- (_ '("--color" "always" "--colors" "path:fg:magenta"
- "--colors" "match:fg:red" "--colors"
- "match:style:bold"))))
- (group-arguments (('nil '("--no-heading"))
- (_ '("--heading"))))
- (context-arguments ,urgrep--context-arguments)
- (regexp-arguments (('nil '("-F"))))
- (case-fold-arguments (((pred identity) '("-i"))))
+ (executable-name . "rg")
+ (regexp-syntax pcre)
+ (arguments executable color file-wildcards group context case-fold regexp
+ "--" query)
+ (color-arguments ('nil '("--color" "never"))
+ (_ '("--color" "always" "--colors" "path:fg:magenta"
+ "--colors" "match:fg:red" "--colors"
+ "match:style:bold")))
+ (group-arguments ('nil '("--no-heading"))
+ (_ '("--heading")))
+ (context-arguments . ,urgrep--context-arguments)
+ (regexp-arguments ('nil '("-F")))
+ (case-fold-arguments ((pred identity) '("-i")))
(file-wildcards-arguments
- (((and x (pred identity))
- (flatten-list (mapcar (lambda (i) (cons "-g" i)) x))))))
+ ((and x (pred identity))
+ (flatten-list (mapcar (lambda (i) (cons "-g" i)) x)))))
(ag
- (executable-name "ag")
- (regexp-syntax (pcre))
- (arguments (executable color file-wildcards group context case-fold regexp
- "--" query))
- (color-arguments (('nil '("--nocolor"))
- (_ '("--color-path" "35" "--color-match" "1;31"))))
- (group-arguments (('nil '("--nogroup"))
- (_ '("--group"))))
- (context-arguments ,urgrep--context-arguments)
- (regexp-arguments (('nil '("-Q"))))
- (case-fold-arguments (('nil '("-s"))
- (_ '("-i"))))
+ (executable-name . "ag")
+ (regexp-syntax pcre)
+ (arguments executable color file-wildcards group context case-fold regexp
+ "--" query)
+ (color-arguments ('nil '("--nocolor"))
+ (_ '("--color-path" "35" "--color-match" "1;31")))
+ (group-arguments ('nil '("--nogroup"))
+ (_ '("--group")))
+ (context-arguments . ,urgrep--context-arguments)
+ (regexp-arguments ('nil '("-Q")))
+ (case-fold-arguments ('nil '("-s"))
+ (_ '("-i")))
(file-wildcards-arguments
- (((and x (pred identity))
- (list "-G" (urgrep--wildcards-to-regexp x 'pcre))))))
+ ((and x (pred identity))
+ (list "-G" (urgrep--wildcards-to-regexp x 'pcre)))))
(ack
- (executable-name "ack")
- (regexp-syntax (pcre))
- (arguments (executable color file-wildcards group context case-fold regexp
- "--" query))
- (color-arguments (('nil '("--nocolor"))
- (_ '("--color-filename" "magenta" "--color-match"
- "bold red"))))
- (group-arguments (('nil '("--nogroup"))
- (_ '("--group"))))
- (context-arguments ,urgrep--context-arguments)
- (regexp-arguments (('nil '("-Q"))))
- (case-fold-arguments (((pred identity) '("-i"))))
+ (executable-name . "ack")
+ (regexp-syntax pcre)
+ (arguments executable color file-wildcards group context case-fold regexp
+ "--" query)
+ (color-arguments ('nil '("--nocolor"))
+ (_ '("--color-filename" "magenta" "--color-match"
+ "bold red")))
+ (group-arguments ('nil '("--nogroup"))
+ (_ '("--group")))
+ (context-arguments . ,urgrep--context-arguments)
+ (regexp-arguments ('nil '("-Q")))
+ (case-fold-arguments ((pred identity) '("-i")))
(file-wildcards-arguments
- (((and x (pred identity))
- (list "-G" (urgrep--wildcards-to-regexp x 'pcre))))))
+ ((and x (pred identity))
+ (list "-G" (urgrep--wildcards-to-regexp x 'pcre)))))
(git-grep
- (executable-name "git")
- (vc-backend "Git")
- (regexp-syntax (bre ere pcre))
- (arguments (executable "--no-pager" color "-n" "--recurse-submodules"
group
- context case-fold regexp "-e" query "--"
- file-wildcards))
+ (executable-name . "git")
+ (vc-backend . "Git")
+ (regexp-syntax bre ere pcre)
+ (arguments executable "--no-pager" color "-n" "--recurse-submodules" group
+ context case-fold regexp "-e" query "--" file-wildcards)
;; git is a bit odd in that color specification happens *before* the
;; subcommand and turning colors on/off happens *after*, so
;; `color-arguments' needs to include the subcommand "grep".
- (color-arguments (('nil '("grep" "--no-color"))
- (_ '("-c" "color.grep.filename=magenta" "-c"
- "color.grep.match=bold red" "grep" "--color"))))
- (group-arguments (((pred identity) '("--heading" "--break"))))
- (context-arguments ,urgrep--context-arguments)
- (regexp-arguments (('bre '("-G"))
- ('ere '("-E"))
- ('pcre '("-P"))
- (_ '("-F"))))
- (case-fold-arguments (((pred identity) '("-i"))))
- (file-wildcards-arguments ((x x))))
+ (color-arguments ('nil '("grep" "--no-color"))
+ (_ '("-c" "color.grep.filename=magenta" "-c"
+ "color.grep.match=bold red" "grep" "--color")))
+ (group-arguments ((pred identity) '("--heading" "--break")))
+ (context-arguments . ,urgrep--context-arguments)
+ (regexp-arguments ('bre '("-G"))
+ ('ere '("-E"))
+ ('pcre '("-P"))
+ (_ '("-F")))
+ (case-fold-arguments ((pred identity) '("-i")))
+ (file-wildcards-arguments (x x)))
(grep
- (executable-name "grep")
- (regexp-syntax (bre ere pcre))
- (command-function ,#'urgrep--rgrep-command)
- (process-setup ,#'urgrep--rgrep-process-setup)
- (context-arguments ,urgrep--context-arguments)
+ (executable-name . "grep")
+ (regexp-syntax bre ere pcre)
+ (command-function . ,#'urgrep--rgrep-command)
+ (process-setup . ,#'urgrep--rgrep-process-setup)
+ (context-arguments . ,urgrep--context-arguments)
;; XXX: On MS Windows, -P and -F seem to cause issues due to the default
;; locale. Setting LC_ALL=en_US.utf8 fixes this, but I'm not sure if this
;; is the right thing to do in general...
- (regexp-arguments (('bre '("-G"))
- ('ere '("-E"))
- ('pcre '("-P"))
- (_ '("-F"))))
- (case-fold-arguments (((pred identity) '("-i"))))))
+ (regexp-arguments ('bre '("-G"))
+ ('ere '("-E"))
+ ('pcre '("-P"))
+ (_ '("-F")))
+ (case-fold-arguments ((pred identity) '("-i")))))
"An alist of known tools to try when running urgrep.")
(defcustom urgrep-preferred-tools nil
@@ -304,7 +303,7 @@ the default tool to use on that host.")
(defun urgrep--get-prop (prop tool)
"Get the property PROP from TOOL, or nil if PROP is undefined."
- (cadr (assq prop (cdr tool))))
+ (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."
- [elpa] externals/urgrep 8065bb9f5e 039/115: Update requirements and fix failing MS Windows test, (continued)
- [elpa] externals/urgrep 8065bb9f5e 039/115: Update requirements and fix failing MS Windows test, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep b0dbe7c6c1 046/115: Update heading, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep e9e70552db 057/115: Use 'format-prompt' if available, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 6f5813ba78 062/115: Add support for wgrep; resolves #2, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 69e45bad3c 069/115: Fix unit tests for git-grep, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 8c6e3d5ba2 101/115: Ensure we get exactly the colors we want, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 2523b6ed4e 108/115: Improve line wrapping slightly, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep e70773d86b 035/115: Refactor urgrep-process-setup so tools can define their own process-setup, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep fdd8dd54e6 044/115: Provide more details in the README, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 3052b8c191 049/115: Use #' read syntax for functions, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 582896b5af 050/115: Use dotted pairs for alist for each tool,
ELPA Syncer <=
- [elpa] externals/urgrep c38b33878f 053/115: Autoloading 'urgrep-setup-hook' really shouldn't be necessary..., ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep a12bd677f7 056/115: Fix 'mouse-face' symbol, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 3370860a1b 043/115: Add support for toggling color output, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep c97985820d 048/115: Minor typographical fixes, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 136b1845d7 020/115: Add support for various regexp syntaxes, defaulting to BRE, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 496647e748 019/115: Add our own toolbar so we get better tooltips, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep ff96211f26 058/115: Update comment, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep d93a565190 060/115: Simplify implementation of 'urgrep', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 0270e11849 072/115: Allow directory for `urgrep' and `urgrep-run-command' to be relative, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 86e7055ce5 063/115: Typo, ELPA Syncer, 2023/05/10