Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the option of not overriding package-user-dir #1407

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Add a F# module.
* Auto-install `use-package`.
* Add `prelude-vertico` module. Vertico a simpler alternative to `ivy-mode` and supersedes Selectrum.
* Add `prelude-override-package-user-dir` to avoid overriding package-user-dir.

### Changes

Expand Down
8 changes: 6 additions & 2 deletions core/prelude-packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@
(if (file-exists-p prelude-pinned-packages-file)
(load prelude-pinned-packages-file)))

;; set package-user-dir to be relative to Prelude install path
(setq package-user-dir (expand-file-name "elpa" prelude-dir))

(when prelude-override-package-user-dir
;; set package-user-dir to be relative to Prelude install path
(setq package-user-dir (expand-file-name "elpa" prelude-dir))
)

(package-initialize)

;; install & enable use-package
Expand Down
9 changes: 9 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,12 @@ desktop environments might be making heavy use of such keybindings. (in most cas
Some of these settings (those that don't need to be pre-loaded) can also be set
on a per-file or directory basis by using a file local variable or a
`.dir-locals.el` file.

### package-user-dir

By default, prelude sets the directory where downloaded modules are installed to `<prelude-dir>/elpa`. If you want
to disable this behaviour, set the following variable to nil before loading prelude.

```emacs-lisp
(setq prelude-override-package-user-dir nil)
```
3 changes: 3 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ by Prelude.")
"This folder stores all the automatically generated save/history-files.")
(defvar prelude-modules-file (expand-file-name "prelude-modules.el" prelude-personal-dir)
"This file contains a list of modules that will be loaded by Prelude.")
(defvar prelude-override-package-user-dir t
"By default prelude installs downloaded packages in <prelude-dir>/elpa.
Set to nil to override this behaviour")

(unless (file-exists-p prelude-savefile-dir)
(make-directory prelude-savefile-dir))
Expand Down