]> code.delx.au - gnu-emacs/commitdiff
Avoid empty -path arguments in rgrep
authorPhil Sainty <psainty@orcon.net.nz>
Wed, 30 Sep 2015 07:39:21 +0000 (10:39 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 30 Sep 2015 07:39:21 +0000 (10:39 +0300)
* 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)

lisp/progmodes/grep.el

index 3240ee8a0db049e74d615ac2e0955c97944b3c6e..452a42f4bc2989d09b112a083b24f6c4a00e2582 100644 (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 ")")