summaryrefslogtreecommitdiffstats
path: root/lisp/init-package.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/init-package.el')
-rw-r--r--lisp/init-package.el16
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/init-package.el b/lisp/init-package.el
index 2f4fe74..2a653a7 100644
--- a/lisp/init-package.el
+++ b/lisp/init-package.el
@@ -22,17 +22,13 @@
(when (>= libgnutls-version 30603)
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
-(defun mpolden/require-package (package &optional min-version no-refresh)
- "Install given PACKAGE, optionally requiring MIN-VERSION.
-If NO-REFRESH is non-nil, the available package lists will not be
-re-downloaded in order to locate PACKAGE."
- (if (package-installed-p package min-version)
- t
- (if (or (assoc package package-archive-contents) no-refresh)
- (package-install package)
+(defun mpolden/require-package (package)
+ "Install given PACKAGE if it's not already installed."
+ (or (package-installed-p package)
(progn
- (package-refresh-contents)
- (mpolden/require-package package min-version t)))))
+ (unless (assoc package package-archive-contents)
+ (package-refresh-contents))
+ (package-install package))))
(defvar mpolden/inhibited-features nil "List of features that should not be loaded.")