Skip to content

Commit

Permalink
feat(use-package): add an option to keep the "check if disabled" advice
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 26, 2023
1 parent 6615a59 commit f08c370
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/me-use-package-extra.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,19 @@
(add-to-list 'minemacs-configured-packages package t)
(apply origfn package args))))

;; If you want to keep the `+use-package--check-if-disabled-a' advice after
;; loading MinEmacs' modules. You need to set in in your
;; "$MINEMACSDIR/early-config.el"
(defvar +use-package-keep-checking-for-disabled-p nil)

;; The previous advice will be removed after loading MinEmacs packages to avoid
;; messing with the user configuration (for example, if the user manually
;; install a disabled package).
(add-hook
'minemacs-after-loading-modules-hook
(defun +use-package--remove-check-if-disabled-advice-h ()
(advice-remove 'use-package '+use-package--check-if-disabled-a))))
(unless +use-package-keep-checking-for-disabled-p
(advice-remove 'use-package '+use-package--check-if-disabled-a)))))


(provide 'me-use-package-extra)
Expand Down

0 comments on commit f08c370

Please sign in to comment.