From: Lars Ingebrigtsen Date: Thu, 2 Jun 2022 13:06:27 +0000 (+0200) Subject: Make `M-x grep' work better with "git grep" X-Git-Tag: emacs-29.0.90~1910^2~274 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=da736c9f028f4d8fb117f116569fb72f706c9b45;p=emacs.git Make `M-x grep' work better with "git grep" * lisp/progmodes/compile.el (compilation-start): Bind PAGER to "" to avoid errors in output from "git grep" and similar commands (bug#4359). --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 8b70e8400b2..d28fce9dbd7 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1956,6 +1956,9 @@ Returns the compilation buffer created." (and (derived-mode-p 'comint-mode) (comint-term-environment)) (list (format "INSIDE_EMACS=%s,compile" emacs-version)) + ;; Some external programs (like "git grep") use a pager; + ;; defeat that. + (list "PAGER=") (copy-sequence process-environment)))) (setq-local compilation-arguments (list command mode name-function highlight-regexp))