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

init.el: setup user-emacs-directory when load #520

Closed
wants to merge 1 commit into from
Closed

init.el: setup user-emacs-directory when load #520

wants to merge 1 commit into from

Conversation

coldnew
Copy link
Contributor

@coldnew coldnew commented Feb 1, 2015

user-emacs-directory is defined by emacs when load config, in most case
it's value is ~/.emacs.d. We setup this variable in init.el to make
existing emacs user can test spacemacs by

emacs -q -l ~/spacemacs/init.el

without change their own ~/.emacs.d config.

Signed-off-by: Yen-Chin Lee coldnew.tw@gmail.com

user-emacs-directory is defined by emacs when load config, in most case
it's value is ~/.emacs.d. We setup this variable in init.el to make
existing emacs user can test spacemacs by

   emacs -q -l ~/spacemacs/init.el

without change their own ~/.emacs.d config.

Signed-off-by: Yen-Chin Lee <coldnew.tw@gmail.com>
syl20bnr added a commit that referenced this pull request Feb 2, 2015
I cherry-picked it and played with it.
There is a major problem with this approach: all `after-init-hooks` will
be triggered right away because the hook is run before the end of the
alternate init
file ([source](https://groups.google.com/forum/#!topic/gnu.emacs.help/IrMz48PQykk))
. It leads to numerous errors, I fixed the spacemacs ones but obviously
I cannot fix the errors from packages. The remaining errors don't
prevent spacemacs from working but they give a very bad impression on
spacemacs quality with errors logs in `*Messages*`.

For those reasons I revert back this change as well as the documentation
I added.

#520
@syl20bnr
Copy link
Owner

syl20bnr commented Feb 2, 2015

I cherry-picked it and played with it.
There is a major problem with this approach: all after-init-hooks will be triggered right away because the hook is run before the end of the alternate init file (source) . It leads to numerous errors, I fixed the spacemacs ones but obviously I cannot fix the errors from packages. The remaining errors don't prevent spacemacs from working but they give a very bad impression on spacemacs quality with errors logs in *Messages*.

For those reasons I revert back this change as well as the documentation I added. See commit 23c2314

@syl20bnr syl20bnr closed this Feb 2, 2015
@syl20bnr
Copy link
Owner

syl20bnr commented Feb 2, 2015

Anyway thank you for the PR !

@syl20bnr
Copy link
Owner

syl20bnr commented Feb 2, 2015

There is a clean way to do it mentioned in the source above but it involved playing with ~/.emacs file. Although not as intrusive as making a backup of one's current configuration, it is still intrusive, so I prefer the simplicity of only one way to install it. In the end it is just a matter of moving one directory.

@coldnew
Copy link
Contributor Author

coldnew commented Feb 3, 2015

It's ok, I use another way to suite my need without hack the spacemacs,
the reason why I want to dynamic select is because I can't give up my emacs right now,
instead, I open both spacemacs and emacs to write my code.

My method as following repo, first I load my own init.el, then set the user-emacs-directory to spacemacs-dir.

https://github.com/coldnew/coldnew-spacemacs

@syl20bnr
Copy link
Owner

syl20bnr commented Feb 3, 2015

That's cool. It would be cool if emacs -q -l ~/spacemacs/init.el can work without being force to code work-arounds to support it, anyway thank you I was very glad to merge your proposal but unfortunately it did not work as expected.
Your method works because you load spacemacs init inside your init.el, it requires non trivial manipulation so it is hard to offer this mechanism to someone willing to try spacemacs. It has to be simpler than renaming two folders.

@opsahl
Copy link

opsahl commented Feb 5, 2015

A better way to run spacemacs from a separate directory is to install it in
/your/chosen/path/.emacs.d/
and then run emacs like this:
env HOME=$HOME/your/chosen/path emacs &

and then you can alias the admittably ugly way of starting it to something like spacemacs

vijaykiran pushed a commit to vijaykiran/spacemacs that referenced this pull request Mar 17, 2015
I cherry-picked it and played with it.
There is a major problem with this approach: all `after-init-hooks` will
be triggered right away because the hook is run before the end of the
alternate init
file ([source](https://groups.google.com/forum/#!topic/gnu.emacs.help/IrMz48PQykk))
. It leads to numerous errors, I fixed the spacemacs ones but obviously
I cannot fix the errors from packages. The remaining errors don't
prevent spacemacs from working but they give a very bad impression on
spacemacs quality with errors logs in `*Messages*`.

For those reasons I revert back this change as well as the documentation
I added.

syl20bnr#520
@syl20bnr syl20bnr mentioned this pull request May 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants