emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 01/01: * lisp/progmodes/grep.el (grep-compute-defau


From: Juri Linkov
Subject: [Emacs-diffs] master 01/01: * lisp/progmodes/grep.el (grep-compute-defaults): Compute grep-highlight-matches before its use.
Date: Tue, 18 Nov 2014 22:05:14 +0000

branch: master
commit 239aa11e1eeb1aa7a1247c40cfac2fe43b715e25
Author: Juri Linkov <address@hidden>
Date:   Wed Nov 19 00:05:09 2014 +0200

    * lisp/progmodes/grep.el (grep-compute-defaults): Compute 
grep-highlight-matches before its use.
---
 lisp/ChangeLog         |    5 +++++
 lisp/progmodes/grep.el |   22 ++++++++++++----------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ba01694..7763d25 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
 2014-11-18  Juri Linkov  <address@hidden>
 
+       * progmodes/grep.el (grep-compute-defaults):
+       Compute grep-highlight-matches before its use.
+
+2014-11-18  Juri Linkov  <address@hidden>
+
        * replace.el (query-replace-from-to-separator): Turn defvar into
        defcustom.  Wrap char-displayable-p in ignore-errors because an
        attempt to autoload char-displayable-p fails during pre-loading.
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index fd48adc..b0d4b5a 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]