[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#44983: Truncate long lines of grep output
From: |
Juri Linkov |
Subject: |
bug#44983: Truncate long lines of grep output |
Date: |
Thu, 24 Dec 2020 22:33:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
> Anyway, I found the shortest change needed to support ripgrep,
> and pushed to master.
Here is another patch needed to support rg because currently rg fails
when --color is used without a value. OTOH, in grep --color is the same as
--color=auto, so this is a win-win situation:
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 5dc99cc7e9..ef73dac4c0 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -79,7 +79,7 @@ grep-highlight-matches
markers for highlighting and adds the --color option in front of
any explicit grep options before starting the grep.
-When this option is `auto', grep uses `--color' to highlight
+When this option is `auto', grep uses `--color=auto' to highlight
matches only when it outputs to a terminal (when `grep' is the last
command in the pipe), thus avoiding the use of any potentially-harmful
escape sequences when standard output goes to a file or pipe.
@@ -95,7 +95,7 @@ grep-highlight-matches
:type '(choice (const :tag "Do not highlight matches with grep markers" nil)
(const :tag "Highlight matches with grep markers" t)
(const :tag "Use --color=always" always)
- (const :tag "Use --color" auto)
+ (const :tag "Use --color=auto" auto)
(other :tag "Not Set" auto-detect))
:set #'grep-apply-setting
:version "22.1")
@@ -743,7 +743,7 @@ grep-compute-defaults
`(nil nil nil "--color" "x" ,(null-device))
nil 1)
(if (eq grep-highlight-matches 'always)
- "--color=always" "--color"))
+ "--color=always" "--color=auto"))
"")
grep-options)))
(unless grep-template
@@ -1000,7 +1000,7 @@ grep-expand-template
((eq grep-highlight-matches 'always)
(push "--color=always" opts))
((eq grep-highlight-matches 'auto)
- (push "--color" opts)))
+ (push "--color=auto" opts)))
opts))
(excl . ,excl)
(dir . ,dir)
- bug#44983: Truncate long lines of grep output, (continued)
- bug#44983: Truncate long lines of grep output, Jean Louis, 2020/12/09
- bug#44983: Truncate long lines of grep output, Juri Linkov, 2020/12/10
- bug#44983: Truncate long lines of grep output, Jean Louis, 2020/12/10
- bug#44983: Truncate long lines of grep output, Juri Linkov, 2020/12/12
- bug#44983: Truncate long lines of grep output, Eli Zaretskii, 2020/12/13
- bug#44983: Truncate long lines of grep output, Jean Louis, 2020/12/13
- bug#44983: Truncate long lines of grep output, Juri Linkov, 2020/12/13
- bug#44983: Truncate long lines of grep output, Eli Zaretskii, 2020/12/14
- bug#44983: Truncate long lines of grep output, Dmitry Gutov, 2020/12/14
- bug#44983: Truncate long lines of grep output, Jean Louis, 2020/12/13
- bug#44983: Truncate long lines of grep output,
Juri Linkov <=
- bug#44983: Truncate long lines of grep output, Dmitry Gutov, 2020/12/24
- bug#44983: Truncate long lines of grep output, Richard Stallman, 2020/12/08
- bug#44983: Truncate long lines of grep output, Dmitry Gutov, 2020/12/08
bug#44983: Truncate long lines of grep output, Juri Linkov, 2020/12/01