emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master c6ee95d: Restore <D> instead of '.' in grep-find-te


From: Dmitry Gutov
Subject: [Emacs-diffs] master c6ee95d: Restore <D> instead of '.' in grep-find-template
Date: Wed, 03 Jun 2015 02:45:23 +0000

branch: master
commit c6ee95ddeefc17410e15090539d0cb220ab6947c
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Restore <D> instead of '.' in grep-find-template
    
    * lisp/cedet/semantic/symref/grep.el
    (semantic-symref-grep-use-template): Update a comment.
    
    * lisp/progmodes/grep.el (grep-compute-defaults): Restore <D>
    instead of '.' in grep-find-template (bug#20719).
    (rgrep): Pass nil as the directory to rgrep-default-command.
    
    * lisp/progmodes/grep.el (grep-expand-keywords): Use '.' as the
    default value for DIR.
    
    * lisp/progmodes/xref.el (xref-collect-matches): Drop the
    workaround.
---
 lisp/cedet/semantic/symref/grep.el |    2 +-
 lisp/progmodes/grep.el             |   12 ++++++------
 lisp/progmodes/xref.el             |    5 -----
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/lisp/cedet/semantic/symref/grep.el 
b/lisp/cedet/semantic/symref/grep.el
index 6325eb4..cea6d4f 100644
--- a/lisp/cedet/semantic/symref/grep.el
+++ b/lisp/cedet/semantic/symref/grep.el
@@ -125,7 +125,7 @@ GREPPATTERN is the pattern used by grep."
                greppattern
                filepattern
                rootdir)))
-    ;; For some reason, my default has no <D> in it.
+    ;; http://debbugs.gnu.org/20719
     (when (string-match "find \\(\\.\\)" cmd)
       (setq cmd (replace-match rootdir t t cmd 1)))
     ;;(message "New command: %s" cmd)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 6981d38..68852f7 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -633,17 +633,17 @@ This function is called from `compilation-filter-hook'."
                                (format "%s " null-device)
                              "")))
                  (cond ((eq grep-find-use-xargs 'gnu)
-                        (format "%s . <X> -type f <F> -print0 | \"%s\" -0 %s"
+                        (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
                                 find-program xargs-program gcmd))
                        ((eq grep-find-use-xargs 'exec)
-                        (format "%s . <X> -type f <F> -exec %s {} %s%s"
+                        (format "%s <D> <X> -type f <F> -exec %s {} %s%s"
                                 find-program gcmd null
                                 (shell-quote-argument ";")))
                        ((eq grep-find-use-xargs 'exec-plus)
-                        (format "%s . <X> -type f <F> -exec %s %s{} +"
+                        (format "%s <D> <X> -type f <F> -exec %s %s{} +"
                                 find-program gcmd null))
                        (t
-                        (format "%s . <X> -type f <F> -print | \"%s\" %s"
+                        (format "%s <D> <X> -type f <F> -print | \"%s\" %s"
                                 find-program xargs-program gcmd))))))))
 
     ;; Save defaults for this host.
@@ -792,7 +792,7 @@ easily repeat a find command."
 
 (defconst grep-expand-keywords
   '(("<C>" . (and cf (isearch-no-upper-case-p regexp t) "-i"))
-    ("<D>" . dir)
+    ("<D>" . (or dir "."))
     ("<F>" . files)
     ("<N>" . null-device)
     ("<X>" . excl)
@@ -992,7 +992,7 @@ to specify a command to run."
                                   grep-find-command)))
            (compilation-start regexp 'grep-mode))
       (setq dir (file-name-as-directory (expand-file-name dir)))
-      (let ((command (rgrep-default-command regexp files dir)))
+      (let ((command (rgrep-default-command regexp files nil)))
        (when command
          (if confirm
              (setq command
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index d6f6ba8..f786d4e 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -757,11 +757,6 @@ tools are used, and when."
          (buf (get-buffer-create " *xref-grep*"))
          (grep-re (caar grep-regexp-alist))
          hits)
-    ;; http://debbugs.gnu.org/20719
-    ;; We want to pass the exact directory to `find', because then
-    ;; `grep' output features absolute file names.
-    (when (string-match "find \\(\\.\\)" command)
-      (setq command (replace-match (shell-quote-argument dir) t t command 1)))
     (with-current-buffer buf
       (erase-buffer)
       (when (eq (call-process-shell-command command nil t) 0)



reply via email to

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