branch: externals/setup
commit 4e15683148a49101234e810af9c2c3340293c43c
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>
Fix 'package-archive-contents' query in :package
Since 'package-archive-contents' is an alist, using 'memq' will always
return nil and therefore unnecessarily call 'package-refresh-contents'.
See
https://lists.sr.ht/~pkal/public-inbox/%[email protected]%3E
---
setup.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.el b/setup.el
index e8960f6458..be1e9bf965 100644
--- a/setup.el
+++ b/setup.el
@@ -537,7 +537,7 @@ If FUNCTION is a list, apply BODY to all elements of
FUNCTION."
(setup-define :package
(lambda (package)
`(unless (package-installed-p ',package)
- (unless (memq ',package package-archive-contents)
+ (unless (assq ',package package-archive-contents)
(package-refresh-contents))
(package-install ',package)))
:documentation "Install PACKAGE if it hasn't been installed yet.