[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep 4fec944d51 016/115: Fix output of git-grep and g
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/urgrep 4fec944d51 016/115: Fix output of git-grep and grep on Linux |
|
Date: |
Wed, 10 May 2023 03:00:38 -0400 (EDT) |
branch: externals/urgrep
commit 4fec944d5157fdb79f4918f619feb35e31ac3481
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Fix output of git-grep and grep on Linux
---
urgrep-tests.el | 2 +-
urgrep.el | 14 ++++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/urgrep-tests.el b/urgrep-tests.el
index 03812cc424..ec4d2c0e82 100644
--- a/urgrep-tests.el
+++ b/urgrep-tests.el
@@ -40,7 +40,7 @@
(ert-deftest urgrep-tests-command-git-grep ()
(let ((tool (assoc "git-grep" urgrep-tools))
- (common-args "git -c color.grep.filename\\=magenta grep -n
--recurse-submodules --color "))
+ (common-args "git --no-pager -c color.grep.filename\\=magenta -c
color.grep.match\\=bold\\ red grep --color -n --recurse-submodules "))
(should (equal (urgrep-command "foo" :tool tool)
(concat common-args "-F --heading --break -e foo")))
(should (equal (urgrep-command "foo" :tool tool :group nil)
diff --git a/urgrep.el b/urgrep.el
index 242afd1c0f..10451daa0d 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -90,8 +90,9 @@
("git-grep"
(executable-name "git")
(vc-backend "Git")
- (pre-arguments ("-c" "color.grep.filename=magenta" "grep" "-n"
- "--recurse-submodules" "--color"))
+ (pre-arguments ("--no-pager" "-c" "color.grep.filename=magenta"
+ "-c" "color.grep.match=bold red" "grep" "--color" "-n"
+ "--recurse-submodules"))
(post-arguments ("-e"))
(group-arguments ((t ("--heading" "--break"))))
(regexp-arguments ((nil ("-F"))))
@@ -295,6 +296,15 @@ for MS shells."
See `compilation-error-regexp-alist' for format details.")
(defun urgrep-process-setup ()
+ ;; XXX: Abstract this grep-specific code out so other tools can do stuff like
+ ;; this.
+ ;; `setenv' modifies `process-environment' let-bound in `compilation-start'
+ ;; Any TERM except "dumb" allows GNU grep to use `--color=auto'.
+ (setenv "TERM" "emacs-urgrep")
+ ;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions.
+ (setenv "GREP_COLOR" "01;31")
+ ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions.
+ (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:sl=:cx=:ne")
(setq-local urgrep-num-matches-found 0
compilation-exit-message-function 'urgrep-exit-message))
- [elpa] externals/urgrep 7453367e6d 065/115: Avoid false-positives when looking for context lines in results, (continued)
- [elpa] externals/urgrep 7453367e6d 065/115: Avoid false-positives when looking for context lines in results, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 593d209a31 067/115: Search in untracked files with git grep, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 1c08b41324 078/115: s/TRAMP/Tramp/g, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 6df13a8dee 071/115: Add support for urgrep command in Eshell, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 11e1f7474e 079/115: Add CI configuration, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep a7d87da8b5 096/115: Slight improvements to docstrings for defcustoms, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 1172efb5a2 107/115: Don't allow using an unknown tool in `urgrep-command`, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 7823d384e6 115/115: Add .elpaignore, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep e5d485de84 034/115: Improve behavior of `urgrep' to allow passing options and add `urgrep-run-command', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 31fe7d5e5c 022/115: Cache the default tool per-host and allow users to override the tool preferences, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 4fec944d51 016/115: Fix output of git-grep and grep on Linux,
ELPA Syncer <=
- [elpa] externals/urgrep f2ac6d6b02 011/115: Fix getting vc backend, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 3fb6b95f21 026/115: Add support for smart case-folding, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep a405b9c459 031/115: Add ability to toggle case-sensitivity for the current search, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 74f38b1021 037/115: Add ability to filter the files to be searched, ELPA Syncer, 2023/05/10
- [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