From b6af090022a7a94202e2a6e86605e1466794c224 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 19 Jan 2019 03:46:07 +0300 Subject: [PATCH] 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. --- lisp/progmodes/project.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 -- 2.39.2