summaryrefslogtreecommitdiff
path: root/lisp/use-package/use-package.el
diff options
context:
space:
mode:
authorAlex Kosorukoff <alex@3form.com>2014-05-06 19:29:48 -0700
committerAlex Kosorukoff <alex@3form.com>2014-05-06 20:38:14 -0700
commit6d02a320f6e6274a27d4cdd721a92d65ff6c3226 (patch)
tree9ae275664a74defe1d211fb4838e46b065ce965b /lisp/use-package/use-package.el
parent9ca3690b59d0923188b168c3e6901790c7021a11 (diff)
downloademacs-6d02a320f6e6274a27d4cdd721a92d65ff6c3226.tar.gz
emacs-6d02a320f6e6274a27d4cdd721a92d65ff6c3226.tar.bz2
emacs-6d02a320f6e6274a27d4cdd721a92d65ff6c3226.zip
if package can't be located, treat it the same way as disabled
There will be a message "Unable to locate <package-name>" in the log.
Diffstat (limited to 'lisp/use-package/use-package.el')
-rw-r--r--lisp/use-package/use-package.el11
1 files changed, 10 insertions, 1 deletions
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