]> git.eshelyaron.com Git - emacs.git/commitdiff
Restore <D> instead of '.' in grep-find-template
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 3 Jun 2015 02:44:48 +0000 (05:44 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 3 Jun 2015 02:45:15 +0000 (05:45 +0300)
* 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
lisp/progmodes/grep.el
lisp/progmodes/xref.el

index 6325eb4a396cbf20468d5b4aee364e152f74bacb..cea6d4f07cdfe79771fe58dd42c99c7c400213f9 100644 (file)
@@ -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)
index 6981d38ee5f564fc6ded1ec98a9ed377d79ddc62..68852f7b55821d877deb828df862d58a94adbc70 100644 (file)
@@ -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
index d6f6ba89ab9f202f84db6e6928fed475617d5bb3..f786d4e3ac703d7c8fad180620d7e19b705157f2 100644 (file)
@@ -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)