From 31f0b2cd00107b83c0cf4b9e1810136472b874ae Mon Sep 17 00:00:00 2001 From: "Tom Breton (Tehom)" Date: Fri, 12 Nov 2010 13:52:00 -0500 Subject: [PATCH] New logic: Don't add to load-path if there are no elisp files in directory. --- elinstall.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/elinstall.el b/elinstall.el index 4e1500c..62da1f4 100644 --- a/elinstall.el +++ b/elinstall.el @@ -944,10 +944,18 @@ surrounds DIR. It may not yet have been added to load-path." (expand-file-name (second spec) dir)) + ;;Relative filenames + (elisp-source-files + (directory-files + dirname + nil + elinstall-elisp-regexp)) (load-path-here - (not - (elinstall-get-parameter - parameters 'block-add-to-load-path))) + (and + elisp-source-files ;;List not empty. + (not + (elinstall-get-parameter + parameters 'block-add-to-load-path)))) (load-path-element (if load-path-here dirname @@ -983,9 +991,7 @@ surrounds DIR. It may not yet have been added to load-path." ;; Otherwise we'll use `def-file' in parameters. ;;$$FIXME Don't do directories, but maybe recurse on - ;;them, if a flag is set. And since we definitely - ;;have a load-path element here, - ;;'block-add-to-load-path according to a parameter. + ;;them, if a flag is set. ;;Maybe could follow/not symlinks similarly. (apply #'nconc (mapcar @@ -995,11 +1001,7 @@ surrounds DIR. It may not yet have been added to load-path." load-path-element dirname parameters)) - - (directory-files - dirname - nil ;;Relative filenames - elinstall-elisp-regexp)))))) + elisp-source-files))))) (def-file (let -- 2.11.4.GIT