From c6ee95ddeefc17410e15090539d0cb220ab6947c Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 3 Jun 2015 05:44:48 +0300 Subject: [PATCH] Restore 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 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 6325eb4a396..cea6d4f07cd 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 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 6981d38ee5f..68852f7b558 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 . -type f -print0 | \"%s\" -0 %s" + (format "%s -type f -print0 | \"%s\" -0 %s" find-program xargs-program gcmd)) ((eq grep-find-use-xargs 'exec) - (format "%s . -type f -exec %s {} %s%s" + (format "%s -type f -exec %s {} %s%s" find-program gcmd null (shell-quote-argument ";"))) ((eq grep-find-use-xargs 'exec-plus) - (format "%s . -type f -exec %s %s{} +" + (format "%s -type f -exec %s %s{} +" find-program gcmd null)) (t - (format "%s . -type f -print | \"%s\" %s" + (format "%s -type 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 '(("" . (and cf (isearch-no-upper-case-p regexp t) "-i")) - ("" . dir) + ("" . (or dir ".")) ("" . files) ("" . null-device) ("" . 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 d6f6ba89ab9..f786d4e3ac7 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) -- 2.11.4.GIT