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

Custom personal dir #1393

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 @@ -12,6 +12,7 @@
* Add a Lua module.
* Auto-install `racket-mode` if needed.
* Add a F# module.
* Custom personal dir

### Changes

Expand Down
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ lexicographical order. The overall loading precedence is:
3. `personal/prelude-modules.el` (or deprecated `prelude-modules.el`)
4. `personal/*`

By setting the environment variable `PRELUDE_PERSONAL_DIR` the
personal directory can be placed outside the main prelude directory.

### Personalization Example

Suppose you want to configure `go-mode` to autoformat on each save. You
Expand Down
7 changes: 6 additions & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@
"The home of Prelude's core functionality.")
(defvar prelude-modules-dir (expand-file-name "modules" prelude-dir)
"This directory houses all of the built-in Prelude modules.")
(defvar prelude-personal-dir (expand-file-name "personal" prelude-dir)
(defvar prelude-personal-dir (or (let ((personal-dir (getenv "PRELUDE_PERSONAL_DIR")))
(when personal-dir
(let ((personal-dir-exp (expand-file-name personal-dir)))
(when (file-directory-p personal-dir-exp)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me without some feedback for the user that they set the wrong thing in the var, this check is kind of pointless.

personal-dir-exp))))
(expand-file-name "personal" prelude-dir))
"This directory is for your personal configuration.

Users of Emacs Prelude are encouraged to keep their personal configuration
Expand Down