Created
September 20, 2016 08:19
-
-
Save bmag/b2119fde2c316cb0c65342253c924527 to your computer and use it in GitHub Desktop.
Emacs dotfile for loading an Emacs configuration based on EMACSDIR environment variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; load configuration from $EMACSDIR/init.el and set $EMACSDIR as | |
;; `user-emacs-directory'. if $EMACSDIR is not set, use `~/.emacs.d'. | |
(let* ((emacs-dir-env (getenv "EMACSDIR")) | |
(custom-emacs-dir (and emacs-dir-env | |
(file-name-as-directory emacs-dir-env)))) | |
;; `user-emacs-directory' default value is emacs.d" | |
(when custom-emacs-dir | |
(setq user-emacs-directory custom-emacs-dir))) | |
(setq user-init-file (expand-file-name "init.el" user-emacs-directory)) | |
(load user-init-file t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set EMACSDIR=C:/path/to/emacs.d | |
set SPACEMACSDIR=C:/path/to/spacemacs.d | |
C:/path/to/emacs/bin/runemacs.exe %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
EMACSDIR=/path/to/emacs.d SPACEMACSDIR=/path/to/spacemacs.d emacs "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment