]> git.eshelyaron.com Git - emacs.git/commitdiff
Respect ido-ignore-item-p in ido-wide-find-dirs-or-files (tiny change)
authorEyal Lotem <eyal.lotem@gmail.com>
Wed, 12 Jun 2013 07:18:49 +0000 (00:18 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 12 Jun 2013 07:18:49 +0000 (00:18 -0700)
* lisp/ido.el (ido-delete-ignored-files): New function,
split from ido-make-file-list-1.
(ido-wide-find-dirs-or-files): Maybe ignore files.
(ido-make-file-list-1): Use ido-delete-ignored-files.

Fixes: debbugs:13003
lisp/ChangeLog
lisp/ido.el

index 50eb27472d578fad3e636c41dca876d7e8df28a4..a1a080ee9f76394e31ae00d07e07a85d0473be89 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-12  Eyal Lotem  <eyal.lotem@gmail.com>  (tiny change)
+
+       * ido.el (ido-delete-ignored-files): New function,
+       split from ido-make-file-list-1.
+       (ido-wide-find-dirs-or-files): Maybe ignore files.  (Bug#13003)
+       (ido-make-file-list-1): Use ido-delete-ignored-files.
+
 2013-06-12  Leo Liu  <sdl.web@gmail.com>
 
        * progmodes/octave.el (inferior-octave-startup)
index 8087124765c05315b480c7e1c975857672968cd2..1b7d4e78cb734326a678ed8439857d67e306fd82 100644 (file)
@@ -3273,17 +3273,25 @@ for first matching file."
              cur nil)))
     res))
 
+(require 'cl-lib)
+
+(defun ido-delete-ignored-files (files)
+  (cl-delete-if
+   (lambda (name) (ido-ignore-item-p name ido-ignore-files t))
+   files))
+
 (defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
   ;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir")
   (let ((filenames
-        (split-string
-         (shell-command-to-string
-          (concat "find "
-                  (shell-quote-argument dir)
-                  " -name "
-                  (shell-quote-argument
-                   (concat (if prefix "" "*") file "*"))
-                  " -type " (if finddir "d" "f") " -print"))))
+         (ido-delete-ignored-files
+          (split-string
+           (shell-command-to-string
+            (concat "find "
+                    (shell-quote-argument dir)
+                    " -name "
+                    (shell-quote-argument
+                     (concat (if prefix "" "*") file "*"))
+                    " -type " (if finddir "d" "f") " -print")))))
        filename d f
        res)
     (while filenames
@@ -3578,12 +3586,10 @@ This is to make them appear as if they were \"virtual buffers\"."
   ;; If MERGED is non-nil, each file is cons'ed with DIR
   (and (or (ido-is-tramp-root dir) (ido-is-unc-root dir)
           (file-directory-p dir))
-       (delq nil
-            (mapcar
-             (lambda (name)
-               (if (not (ido-ignore-item-p name ido-ignore-files t))
-                   (if merged (cons name dir) name)))
-             (ido-file-name-all-completions dir)))))
+       (mapcar
+       (lambda (name) (if merged (cons name dir) name))
+       (ido-delete-ignored-files
+        (ido-file-name-all-completions dir)))))
 
 (defun ido-make-file-list (default)
   ;; Return the current list of files.