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

Adds better personal configurations to Prelude #1389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 27 additions & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,30 @@
"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
(cond
((featurep 'chemacs)
(if (getenv "PRELUDE_PERSONAL_DIR")
(expand-file-name (getenv "PRELUDE_PERSONAL_DIR"))
(expand-file-name "personal" prelude-dir)))
((getenv "PRELUDE_PERSONAL_DIR") (expand-file-name (getenv "PRELUDE_PERSONAL_DIR")))
((or (getenv "XDG_CONFIG_HOME") (file-exists-p (expand-file-name ".config/prelude-personal" (getenv "HOME"))))
(if (getenv "XDG_CONFIG_HOME")
(expand-file-name "prelude-personal" (getenv "XDG_CONFIG_HOME"))
(expand-file-name ".config/prelude-personal" (getenv "HOME"))))
((getenv "HOME") (expand-file-name ".prelude-personal" (getenv "HOME"))))
"This directory is for your personal configuration.

In order do these checks:
* using chemacs?
** yes, and have specified a location with the PRELUDE_PERSONAL_DIR
environment variable
** yes, but no environment variable, assume the prelude-dir/personal
folder in the profile
* use PRELUDE_PERSONAL_DIR environment variable
* XDG_CONFIG_HOME or the path .config/prelude-personal exists.
* use HOME environment variable.

Users of Emacs Prelude are encouraged to keep their personal configuration
changes in this directory. All Emacs Lisp files there are loaded automatically
by Prelude.")
Expand All @@ -73,6 +94,11 @@ by Prelude.")
(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.")

;; make sure the `prelude-personal-dir' is on the load path so the user
;; can load `custom.el' from there if desired.
(unless (file-exists-p prelude-personal-dir) (mkdir prelude-personal-dir t))
(add-to-list 'load-path (expand-file-name prelude-personal-dir))

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

Expand Down