Skip to content

Commit

Permalink
tweak(core): save a list of packages configured by MinEmacs
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jun 11, 2023
1 parent 856e474 commit bdd3898
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion core/me-bootstrap.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@
;; Defer loading packages by default, use `:demand' to force loading a package
use-package-always-defer t)

;; HACK: This advice around `use-package' checks if a package is disabled
;; HACK: This advice around `use-package' checks if a package is disabled in
;; `minemacs-disabled-packages' before calling `use-package'. This can come
;; handy if the user wants to enable some module while excluding some packages
;; from it.
(advice-add
'use-package :around
(defun +use-package--check-if-disabled-a (origfn package &rest args)
(add-to-list 'minemacs-configured-packages package t)
(unless (memq package minemacs-disabled-packages)
(apply origfn package args))))

Expand Down
9 changes: 7 additions & 2 deletions core/me-vars.el
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ Compiled from the `system-configuration-features'.")
:group 'minemacs-ui
:type 'symbol)

(defcustom minemacs-disabled-packages '()
(defcustom minemacs-disabled-packages nil
"List of packages to be disabled when loading MinEmacs modules.
This can be useful if you want to enable a module but you don't want a package
of being enabled.")
of being enabled."
:group 'minemacs-core
:type '(list symbol))

(defvar minemacs-configured-packages nil
"List of packages installed and configured by MinEmacs during startup.")

(defcustom minemacs-after-loading-modules-hook nil
"This hook will be run after loading MinEmacs modules.
Expand Down

0 comments on commit bdd3898

Please sign in to comment.