Anonymous committed d1747e7

added readme

Comments (0)

Files changed (2)

 (setq certainty/base-dir (file-name-directory (or (buffer-file-name) load-file-name)))
 (setq certainty/root-dir (concat certainty/base-dir "root/"))
 (setq certainty/vendor-dir (concat certainty/root-dir "vendor/"))
-(setq certainty/active-profile (concat certainty/root-dir "active-profile"))
+(setq certainty/active-profile (concat certainty/root-dir "active-profile/"))
 (setq load-path (append load-path (list certainty/base-dir certainty/vendor-dir)))
 ;; run the boot sequence
 (when (file-exists-p certainty/active-profile)
+  (setq custom-file (concat certainty/active-profile "custom.el"))
   ;; load alpha file that does basic initialization
   (load-if-exists (concat certainty/active-profile "alpha.el"))
         (dolist (src (directory-files current-runlevel 1 ".*el$"))
     	  (load src)))))
+  (load-if-exists custom-file)
   ;; lastly load omega to finish things up
   (load-if-exists (concat certainty/active-profile "omega.el")))
+# Emacs-Bootup
+This is my attempt to structure my emacs-files. My specific needs are that I use Emacs both at home and at work. I want it to behave
+basically the same but of course I have environment specific settings.
+Also I wanted a way to steer when files are loaded during the boot. I figured that some files are very basic and need to go before
+any other files.
+The way i solved it is basically two things:
+1) profiles
+2) runlevels
+## Quickstart
+Just clone the repository as ${HOME}/.emacs.d
+Once you've done this all you need to do is to create a profile.
+    mkdir -p ~/.emacs.d/root/profiles/your_profile/runlevel{0,1,2}
+    ln -s ~/.emacs.d/root/profiles/your_profile ~/.emacs.d/root/profiles/active-profile
+Now you can use this setup to place your files in the different runlevels and they will be loaded
+from smallest to greatest. My default there are *three runleveles*.
+## Details
+### Profiles
+A profile holds environment specific settings. A profile is represented by a directory that has the following content.
+ profile-dir
+   |
+   |- alpha.el
+   |- custom.el
+   |- omega.el
+   |- runlevel0
+   |- runlevel1
+   |- runlevel2
+Runlevel0-2 are directories that may hold your elisp files. The rest of the files are used to do pre- and post-actions to the boot-process.
+The custom-file holds custom UX settings.
+#### Active Profile
+In order to activate a profile you need to create  symlink into the root-directory.
+    ln -s ~/.emacs.d/root/profiles/my-profile ~/.emacs.d/root/active-profile
+#### Alpha and Omega
+Each profile may contain an alpha and an omega file. Those are named
+*alpha.el* and *omega.el* and haved to be placed in the profile's root directory.
+These can be used to do something at the very start or the very end of the boot-process
+The alpha-file will be loaded before any other file whereas the omega-file is loaded
+after all other files have been loaded. 
+### The base profile
+You might have noticed that there is already a folder called base in the profiles directory.
+This is for cased where you have files that you need in all other profiles.
+Just put those files there and *symlink* them into your active-profile
+### Runlevels
+Currently there are three runlevels, which you can use to drive the order of evaluation of your
+configuration files. This is really easy as you just have to place the files that should go before 
+other files in the runlevel that goes before the other.
+## Boot-Process
+The bootprocess is as follows:
+* load active profile's alpha.el if it exists
+* load active profile's runlevels
+* load active profile's custom.el if it exists
+* load active profile's omega.el if it exists
+## Elisp
+The following bindings are available and can be used by your elisp files:
+* certainty/available-runlevels - The number of available runlevels (default 3)
+* certainty/base-dir - The path to your ~/.emacs.d
+* certainty/root-dir - The path to ~/.emacs.d/root
+* certainty/active-profile - The path to the currently active-profile
+* certainty/vendor-dir - The path to your vendor directory
+* custom-file - The path to the custom file
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.