diff --git a/core/autoload/packages.el b/core/autoload/packages.el index 04278e50d..f79eb7e2e 100644 --- a/core/autoload/packages.el +++ b/core/autoload/packages.el @@ -108,7 +108,8 @@ Used by `doom/packages-autoremove'." (doom-initialize-packages t) (let ((package-selected-packages (append (mapcar 'car doom-packages) doom-core-packages))) - (package--removable-packages))) + (cl-set-difference (package--removable-packages) + doom-protected-packages))) ;;;###autoload (defun doom-get-missing-packages () diff --git a/core/core-os.el b/core/core-os.el index 1720d8479..181c87a77 100644 --- a/core/core-os.el +++ b/core/core-os.el @@ -3,6 +3,11 @@ (defconst IS-MAC (eq system-type 'darwin)) (defconst IS-LINUX (eq system-type 'gnu/linux)) +;; In case this config is shared across multiple computers (like mine are), +;; let's protect these from autoremoval. +(push 'exec-path-from-shell doom-protected-packages) +(push 'osx-clipboard doom-protected-packages) + ;; clipboard (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING) ;; Use a shared clipboard diff --git a/core/core-packages.el b/core/core-packages.el index d3a8cbdd8..a90538cb8 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -54,6 +54,9 @@ package's name as a symbol, and whose CDR is the plist supplied to its "A list of packages that must be installed (and will be auto-installed if missing) and shouldn't be deleted.") +(defvar doom-protected-packages nil + "A list of packages that shouldn't be deleted by `doom/packages-autoremove'.") + (defvar doom-init-time nil "The time it took, in seconds, for DOOM Emacs to initialize.")