Commit 239aa11e authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/progmodes/grep.el (grep-compute-defaults): Compute grep-highlight-matches before its use.

parent c0b877ba
2014-11-18 Juri Linkov <juri@linkov.net>
* progmodes/grep.el (grep-compute-defaults):
Compute grep-highlight-matches before its use.
2014-11-18 Juri Linkov <juri@linkov.net>
* replace.el (query-replace-from-to-separator): Turn defvar into
......
......@@ -556,6 +556,18 @@ This function is called from `compilation-filter-hook'."
(looking-at
(concat (regexp-quote hello-file)
":[0-9]+:English")))))))))
(when (eq grep-highlight-matches 'auto-detect)
(setq grep-highlight-matches
(with-temp-buffer
(and (grep-probe grep-program '(nil t nil "--help"))
(progn
(goto-char (point-min))
(search-forward "--color" nil t))
;; Windows and DOS pipes fail `isatty' detection in Grep.
(if (memq system-type '(windows-nt ms-dos))
'always 'auto)))))
(unless (and grep-command grep-find-command
grep-template grep-find-template)
(let ((grep-options
......@@ -632,16 +644,6 @@ This function is called from `compilation-filter-hook'."
(t
(format "%s . <X> -type f <F> -print | \"%s\" %s"
find-program xargs-program gcmd))))))))
(when (eq grep-highlight-matches 'auto-detect)
(setq grep-highlight-matches
(with-temp-buffer
(and (grep-probe grep-program '(nil t nil "--help"))
(progn
(goto-char (point-min))
(search-forward "--color" nil t))
;; Windows and DOS pipes fail `isatty' detection in Grep.
(if (memq system-type '(windows-nt ms-dos))
'always 'auto)))))
;; Save defaults for this host.
(setq grep-host-defaults-alist
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment