From 6d02a320f6e6274a27d4cdd721a92d65ff6c3226 Mon Sep 17 00:00:00 2001 From: Alex Kosorukoff Date: Tue, 6 May 2014 19:29:48 -0700 Subject: [PATCH] if package can't be located, treat it the same way as disabled There will be a message "Unable to locate " in the log. --- lisp/use-package/use-package.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 36e7e0b757e..4f5c545d0a1 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -300,7 +300,16 @@ For full documentation. please see commentary. (name-symbol (if (stringp name) (intern name) name))) ;; force this immediately -- one off cost - (unless (use-package-plist-get args :disabled) + (unless + (or (use-package-plist-get args :disabled) + (if (locate-library + name-string nil + (mapcar + (lambda (path) (expand-file-name path user-emacs-directory)) + (cond ((stringp pkg-load-path) (list pkg-load-path)) + ((functionp pkg-load-path) (funcall pkg-load-path)) + (t pkg-load-path)))) nil + (message "Unable to locate %s" name-string))) (let* ((ensure (use-package-plist-get args :ensure)) (package-name -- 2.39.2