Skip to content

Commit

Permalink
Move ublt/package-install from ublt-util.el to init.el
Browse files Browse the repository at this point in the history
  • Loading branch information
ubolonton committed Feb 23, 2020
1 parent ed9d45e commit c2f8dca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 0 additions & 10 deletions config/ublt-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,6 @@
nil))
(require feature filename)))

(defvar ublt/package-errors ())
(defun ublt/package-install (pkg)
(when (not (package-installed-p pkg))
(condition-case err
(package-install pkg nil)
(error
(setq ublt/package-errors (plist-put ublt/package-errors pkg err))
(message (propertize "Failed to install %s: %s" 'face 'font-lock-keyword-face)
pkg err)))))

;;; TODO: Use `use-package'.
(defmacro ublt/set-up (feature &rest body)
"Try loading the feature, running BODY afterward, notifying
Expand Down
10 changes: 10 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@
(when (not package-archive-contents)
(package-refresh-contents))

(defvar ublt/package-errors ())
(defun ublt/package-install (pkg)
(when (not (package-installed-p pkg))
(condition-case err
(package-install pkg nil)
(error
(setq ublt/package-errors (plist-put ublt/package-errors pkg err))
(message (propertize "Failed to install %s: %s" 'face 'font-lock-keyword-face)
pkg err)))))

(dolist (p ublt/packages)
(ublt/package-install p))

Expand Down

0 comments on commit c2f8dca

Please sign in to comment.