(let* ((host-id
(intern (or (file-remote-p default-directory) "localhost")))
(host-defaults (assq host-id grep-host-defaults-alist))
- (defaults (assq nil grep-host-defaults-alist)))
+ (defaults (assq nil grep-host-defaults-alist))
+ (quot-braces (shell-quote-argument "{}"))
+ (quot-scolon (shell-quote-argument ";")))
;; There are different defaults on different hosts. They must be
;; computed for every host once.
(dolist (setting '(grep-command grep-template
"")))
(cons
(if (eq grep-find-use-xargs 'exec-plus)
- (format "%s %s{} +" cmd0 null)
- (format "%s {} %s%s" cmd0 null
- (shell-quote-argument ";")))
+ (format "%s %s%s +" cmd0 null quot-braces)
+ (format "%s %s %s%s" cmd0 quot-braces null quot-scolon))
(1+ (length cmd0)))))
(t
(format "%s . -type f -print | \"%s\" %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 <D> <X> -type f <F> -exec %s {} %s%s"
- find-program gcmd null
- (shell-quote-argument ";")))
+ (format "%s <D> <X> -type f <F> -exec %s %s %s%s"
+ find-program gcmd quot-braces null quot-scolon))
((eq grep-find-use-xargs 'exec-plus)
- (format "%s <D> <X> -type f <F> -exec %s %s{} +"
- find-program gcmd null))
+ (format "%s <D> <X> -type f <F> -exec %s %s%s +"
+ find-program gcmd null quot-braces))
(t
(format "%s <D> <X> -type f <F> -print | \"%s\" %s"
find-program xargs-program gcmd))))))))