From: Dmitry Gutov Date: Sat, 19 Jan 2019 00:46:07 +0000 (+0300) Subject: Misc ignore-related project.el changes X-Git-Tag: emacs-27.0.90~3784 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b6af090022a7a94202e2a6e86605e1466794c224;p=emacs.git Misc ignore-related project.el changes * lisp/progmodes/project.el (project-ignores): Don't append the default ignores list, just use vc-directory-exclusion-list. (project--dir-ignores): Use the default ignores if the dir is outside of the current project. (project-files): Use project--dir-ignores to support external roots better. --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index f795c36fa06..754659d6c99 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -184,7 +184,8 @@ to find the list of ignores for each directory." (require 'xref) (cl-mapcan (lambda (dir) - (project--files-in-directory dir (project-ignores project dir))) + (project--files-in-directory dir + (project--dir-ignores project dir))) (or dirs (project-roots project)))) (defun project--files-in-directory (dir ignores &optional files) @@ -283,7 +284,10 @@ backend implementation of `project-external-roots'.") entry)) (vc-call-backend backend 'ignore-completion-table root))) (project--value-in-dir 'project-vc-ignores root) - (cl-call-next-method)))) + (mapcar + (lambda (dir) + (concat dir "/")) + vc-directory-exclusion-list)))) (defun project-combine-directories (&rest lists-of-dirs) "Return a sorted and culled list of directory names. @@ -346,7 +350,8 @@ requires quoting, e.g. `\\[quoted-insert]'." (defun project--dir-ignores (project dir) (let* ((roots (project-roots project)) (root (cl-find dir roots :test #'file-in-directory-p))) - (when root + (if (not root) + (project-ignores nil nil) ;The defaults. (let ((ignores (project-ignores project root))) (if (file-equal-p root dir) ignores