From: Phil Sainty Date: Wed, 30 Sep 2015 07:39:21 +0000 (+0300) Subject: Avoid empty -path arguments in rgrep X-Git-Tag: emacs-25.0.90~1223^2~63 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3968fa6a44275c16d82704fd29621ac1757bca63;p=emacs.git 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) --- diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 3240ee8a0db..452a42f4bc2 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -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 ")")