Doom-emacs: How to install doom-emacs alongside my emacs config

Created on 3 Jun 2019  路  10Comments  路  Source: hlissner/doom-emacs

Hello,
I would like to try doom emacs but I don't want to screw my current emacs config.
How can I install it alongside my emacs config ?
Can I just put my emacs.d to a new git branch ?
Thx

question elisp resolved

Most helpful comment

@kisai This is false, doom works fine with chemacs.

For example, with the following setup:

  • vanilla config in ~/.emacs.d
  • doom cloned into ~/.emacs.doom.d
  • chemacs installed, providing ~/.emacs

And the following ~/.emacs-profiles.el:

(("default" . ((user-emacs-directory . "~/.emacs.d")))
 ("doom" . ((user-emacs-directory . "~/.emacs.doom.d"))))

The vanilla configuration will launch when running emacs, and doom will run when running emacs --with-profile=doom. If you've moved your doom directory, run bin/doom refresh first to fix the autoloads.

All 10 comments

Hello @4vrel ,

doom-emacs allows to run it from any folder using ./bin/doom run
So you can follow https://github.com/hlissner/doom-emacs/wiki/Getting-Started
but use replace .emacs.d with .emacs.doom.d

Another option is to use chemacs, which lets you have multiple simultaneous emacs profiles, selected with a command-line argument to emacs.

https://github.com/plexus/chemacs

I have tried chemacs and it doesn't work with the bin/doom commands actually doom has hardcoded ~/.emacs.d in some places in the code.

@kisai This is false, doom works fine with chemacs.

For example, with the following setup:

  • vanilla config in ~/.emacs.d
  • doom cloned into ~/.emacs.doom.d
  • chemacs installed, providing ~/.emacs

And the following ~/.emacs-profiles.el:

(("default" . ((user-emacs-directory . "~/.emacs.d")))
 ("doom" . ((user-emacs-directory . "~/.emacs.doom.d"))))

The vanilla configuration will launch when running emacs, and doom will run when running emacs --with-profile=doom. If you've moved your doom directory, run bin/doom refresh first to fix the autoloads.

I have tried that and it works but when i try to run any of the bash commands complains.

@kisai Please post the entire command output with the error message you're seeing, preferably as new issue.

You need to run <doom-emacs-dir>/bin/doom re after you have moved directory different place.

EDIT: I use two different Emacs configurations, one personal (few days ago started configuring) and doom (emacs).

Here is a TL;DR on setting up Chemacs with Doom Emacs: https://gist.github.com/hlissner/d01f035d3fdb2dbbec0d95da7bcd5862

Doom doesn't hardcode the emacs directory. bin/doom resolves the location of your emacs.d based on the location of the bin/doom script itself. e.g. ~/some/folder/containing/doom/bin/doom will assume Doom lives in ~/some/folder/containing/doom.

bin/doom run also allows you to run Doom out of its current location, but all of its startup optimizations are bypassed this way, so it's only good for quick testing.

Here is what i did:

  1. Built my personal emacs setup first.
  2. mv ~/.emacs ~/.my_emacs
  3. mv ~/.emacs.d ~/.my_emacs.d
  4. put this line at the top of ~/.my_emacs
    (setq user-emacs-directory "~/.my_emacs.d/")
  5. Installed doom-emacs

Now switching is easy:

switch to my config:
ln -s ~/.emacs_mine ~/.emacs

switch to doom-emacs:
unlink ~/.emacs

I'll assume the OPs original issue was resolved and close this. In summary, bin/doom run will run Emacs out of the parent directory of the bin/doom script. Otherwise, check out chemacs, here are some TLDR instructions for it. If you have any other problems or questions about this, feel free to follow up here.

Was this page helpful?
0 / 5 - 0 ratings