diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2015-06-03 05:44:48 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2015-06-03 05:45:15 +0300 |
commit | c6ee95ddeefc17410e15090539d0cb220ab6947c (patch) | |
tree | 6e899d28a439298551f946871ea515ab4cf10b24 | |
parent | 0a9e3248af3bab4f35da1473a6330292f5857ccd (diff) | |
download | emacs-c6ee95ddeefc17410e15090539d0cb220ab6947c.tar.gz emacs-c6ee95ddeefc17410e15090539d0cb220ab6947c.tar.bz2 emacs-c6ee95ddeefc17410e15090539d0cb220ab6947c.zip |
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.
-rw-r--r-- | lisp/cedet/semantic/symref/grep.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/grep.el | 12 | ||||
-rw-r--r-- | 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 <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 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 . <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 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) |