Avoid empty -path arguments in rgrep

* lisp/progmodes/grep.el (rgrep-default-command): Remove nil from
the list produced according to grep-find-ignored-directories,
before passing it to Find/Grep invocation.  (Bug#21548)
This commit is contained in:
Phil Sainty 2015-09-30 10:39:21 +03:00 committed by Eli Zaretskii
parent 47089e0cc8
commit 3968fa6a44

View file

@ -1039,16 +1039,18 @@ to specify a command to run."
;; we should use shell-quote-argument here
" -path "
(mapconcat
#'(lambda (ignore)
(cond ((stringp ignore)
(shell-quote-argument
(concat "*/" ignore)))
((consp ignore)
(and (funcall (car ignore) dir)
(shell-quote-argument
(concat "*/"
(cdr ignore)))))))
grep-find-ignored-directories
'identity
(delq nil (mapcar
#'(lambda (ignore)
(cond ((stringp ignore)
(shell-quote-argument
(concat "*/" ignore)))
((consp ignore)
(and (funcall (car ignore) dir)
(shell-quote-argument
(concat "*/"
(cdr ignore)))))))
grep-find-ignored-directories))
" -o -path ")
" "
(shell-quote-argument ")")