From b5ae2fc3b211f03a475d3115e90183f7dbce1981 Mon Sep 17 00:00:00 2001 From: bryce-carson Date: Sun, 20 Mar 2022 21:13:37 -0600 Subject: [PATCH] Refactor core-load-paths to an in-lined form - Remove the two functions that add directories to the load path. - Inline the body forms of the functions to be removed. - Rename the variables to be more explicit. Fix let varlist in core-load-path.el --- core/core-load-paths.el | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/core/core-load-paths.el b/core/core-load-paths.el index 857758238..1d6887f54 100644 --- a/core/core-load-paths.el +++ b/core/core-load-paths.el @@ -114,20 +114,11 @@ (setq pcache-directory (concat spacemacs-cache-directory "pcache/")) ;;;; Load Paths -;; TODO: Since these functions are not called anywhere, consider to inline them (Apr 27 2021 Lucius) - -(defun spacemacs//add-to-load-path (dir) - "Prepend DIR to `load-path'." - (add-to-list 'load-path dir)) - -;; FIXME: unused function (Apr 25 2021 Lucius) -(defun spacemacs//add-to-load-path-if-exists (dir) - "If DIR exists in the file system, prepend it to `load-path'." - (when (file-exists-p dir) - (spacemacs//add-to-load-path dir))) - -(dolist (suffix '(nil "libs/" "libs/spacemacs-theme/" "libs/forks")) - (spacemacs//add-to-load-path (concat spacemacs-core-directory suffix))) +(dolist (subdirectory '(nil "libs/" "libs/spacemacs-theme/" "libs/forks/")) + (let ((path (concat spacemacs-core-directory subdirectory))) + (if (file-exists-p path) + (add-to-list 'load-path path) + (error "The directory %s does not exist and cannot be added to the `load-path'." path)))) ;;;; Themes (add-to-list 'custom-theme-load-path (concat spacemacs-core-directory