]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `M-x grep' work better with "git grep"
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 2 Jun 2022 13:06:27 +0000 (15:06 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 2 Jun 2022 15:21:28 +0000 (17:21 +0200)
* lisp/progmodes/compile.el (compilation-start): Bind PAGER to ""
to avoid errors in output from "git grep" and similar commands
(bug#4359).

lisp/progmodes/compile.el

index 8b70e8400b2037b9f98e6e9c4eb4da918c883801..d28fce9dbd7c21af9dcd1b1e14997a53220bcb59 100644 (file)
@@ -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))