]> git.eshelyaron.com Git - emacs.git/commitdiff
Put "--color" before the other options in grep-command
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 28 Jun 2015 01:29:03 +0000 (04:29 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 28 Jun 2015 01:29:03 +0000 (04:29 +0300)
* lisp/progmodes/grep.el (grep-compute-defaults): Put "--color"
before the other options in grep-command (bug#20912).

lisp/progmodes/grep.el

index e20e5bd4c40c3bc18e7a6fe41f45071e4418bd09..639d8d9365277a109faee011ed8737c0bc697399 100644 (file)
@@ -579,7 +579,7 @@ This function is called from `compilation-filter-hook'."
                         " -e"))))
        (unless grep-command
          (setq grep-command
-               (format "%s %s %s " grep-program grep-options
+               (format "%s %s %s " grep-program
                         (or
                          (and grep-highlight-matches
                               (grep-probe grep-program
@@ -587,7 +587,8 @@ This function is called from `compilation-filter-hook'."
                                           nil 1)
                               (if (eq grep-highlight-matches 'always)
                                   "--color=always" "--color"))
-                         ""))))
+                         "")
+                         grep-options)))
        (unless grep-template
          (setq grep-template
                (format "%s <X> <C> %s <R> <F>" grep-program grep-options)))