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)
(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.
(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)
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
(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)