Commit c6ee95dd authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

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.
parent 0a9e3248
......@@ -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)
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment