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

Add support to doom #5

Closed
drym3r opened this issue May 26, 2018 · 30 comments
Closed

Add support to doom #5

drym3r opened this issue May 26, 2018 · 30 comments

Comments

@drym3r
Copy link

drym3r commented May 26, 2018

Hi!
This package seems very interesting, thanks for your work. I'm triying to make it work with doom, but it doesn't. It would be very useful if you could add support for it.

@plexus
Copy link
Owner

plexus commented May 27, 2018

Hi @drym3r,

I appreciate your interest, but your issue is asking me to do free work without providing any meaningful information.

I've never used doom, in fact this is the first I hear of it. I'm not sure what the problem can be since Chemacs is a very general purpose tool, it shouldn't need "support" for specific configs. That said if we can figure out what the problem is, and if it's something that we can fix, then I'll happily consider a pull request from you or someone else.

Meanwhile it would be helpful to add as much relevant information as possible. What steps did you take? What did you expect to happen? What happened instead? Did you get any errors, warnings, or other output? etc.

Thanks,
Arne

@drym3r
Copy link
Author

drym3r commented May 27, 2018

Sure, I'll try to add as much information as I can. I'm not an expert, so I'll do what I can. My .emacs-profiles.el is:

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

When I execute emacs --with-profile doom, it fails with:

Warning (initialization): An error occurred while loading ‘/home/ap/.emacs’:

File error: Cannot open load file, The file or directory doesn't exists, core-lib

The ~/Proyectos/doom/init.el file contains, among other:

(require 'core (concat user-emacs-directory "core/core"))

That said, I'll add that the doom is an opiniated emacs configuration which tries with various ways to speed up the emacs startup.

If I can add more information, I'll happily do it.

@plexus
Copy link
Owner

plexus commented May 28, 2018

Thanks, that's helpful. Maybe one of the Doom folks has an idea what's going. It seems they precompile a lot of stuff, maybe you have to make sure that precompilation also happens with the right profile so it refers to the right user-emacs-directory. cc @hlissner

@mandarvaze
Copy link
Contributor

mandarvaze commented Jun 5, 2018

I'm able to get doom working (at least it loaded successfully)

My entry is as follows :

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

(This is similar to the entry listed by @drym3r)
Steps I followed : (Not different than ones listed here

  1. Cloned doom repo into ~/doom-emacs
  2. Copied example init file to init.el
  3. make install
  4. emacs --with-profile doom &

(I'm on emacs 26.1 if it matters)

@hlissner
Copy link

hlissner commented Jun 5, 2018

You may want to set doom-private-dir too, since Doom has its own dotfile. e.g.

("doom" . ((user-emacs-directory . "~/doom-emacs")
           (doom-private-dir . "~/doom-config")))

The only caveat is Doom's package management is done externally, through bin/doom (which will eventually replace make). Fortunately, all bin/dooms commands are localized to wherever it is running from, so a Doom install is portable.

I haven't tries chemacs myself, but this should get the two working (assuming the above profile):

git clone https://github.com/hlissner/doom-emacs ~/doom-emacs
~/doom-emacs/bin/doom -p ~/doom-config quickstart
emacs --with-profile doom &

Let me know if that gives you any trouble!


For the curious, bin/doom -p ~/doom-config quickstart is a shortcut for:

mkdir ~/doom-config
cp ~/doom-emacs/init.example.el ~/doom-config/init.el
touch ~/doom-config/config.el
bin/doom install

Also: -p DIR sets doom-private-dir, which defaults to ~/.doom.d (or ~/.config/doom if it exists), and -e DIR sets user-emacs-directory.

@plexus
Copy link
Owner

plexus commented Jun 5, 2018

Thanks @hlissner for chiming in!

("doom" . ((user-emacs-directory . "~/doom")
           (doom-private-dir . "~/doom-config")))

This won't work, Chemacs doesn't know what doom-private-dir is. If there's enough interest we could add the ability to set arbitrary variables, similar to how env works, but currently that's not there. See the README for what's supported.

@hlissner
Copy link

hlissner commented Jun 5, 2018

Oh! I assumed incorrectly. In that case, I'll add a DOOMDIR envvar for setting doom-private-dir (been meaning to do this), so I trust this will work instead?

("doom" . ((user-emacs-directory . "~/doom-emacs")
           (env . (("DOOMDIR" . "~/doom-config")))))

EDIT: And done!

@plexus
Copy link
Owner

plexus commented Jun 5, 2018

Yes, that would be great!

@mandarvaze
Copy link
Contributor

@hlissner How do I update my doom installation with your changes ? (Especially since your changes are in develop branch.

@hlissner
Copy link

hlissner commented Jun 5, 2018

@mandarvaze Are you already using the develop branch? I'd recommend you do, if not. It is almost 2k commits ahead of master (a result of some bad planning, but it's due to be merged into master by this weekend, after which I'll resume a more sane release schedule).

If you are on develop, use bin/doom upgrade.

If you are far back on develop where this command may not work or exist, then do the following from your Doom directory:

doom clean  # remove elc files, if you've run 'doom compile' before
doom sync

Hope that helps!

@drym3r
Copy link
Author

drym3r commented Jun 5, 2018

It works very well, thanks @hlissner and @plexus!

@drym3r drym3r closed this as completed Jun 5, 2018
@plexus
Copy link
Owner

plexus commented Jun 5, 2018

Cool! If anyone feels like adding a Doom section to the README, next to the Spacemacs section, that'd be super awesome :)

@mandarvaze
Copy link
Contributor

@plexus Done. See #6

@JohnMacIsaac
Copy link

JohnMacIsaac commented Mar 20, 2019

@plexus
Ok, I've got it so that I can open/run two versions of emacs (vanilla emacs and spacemacs) in two terminal frames. But how do you open/run two GUI versions of emacs?

It would be great if we could
open spotlight and type "emacs" to open a GUI version of (vanilla) emacs, and then
open spotlight and type "spacemacs" to open a GUI version of spacemacs.

@plexus
Copy link
Owner

plexus commented Mar 20, 2019

Add a spacemacs wrapper script to your path

@JohnMacIsaac
Copy link

JohnMacIsaac commented Mar 23, 2019

Add a spacemacs wrapper script to your path
How do you do that?
(I figured it must be some sort of bash scripting, so I worked my way thru this tutorial: https://ryanstutorials.net/bash-scripting-tutorial/
, but I still don't know how to do that.)

@plexus
Copy link
Owner

plexus commented Mar 24, 2019

Hi @JohnMacIsaac, this is not a support forum. Perhaps consider posting your question to StackOverflow or the like.

@cameronwp
Copy link

In case it's not clear from the discussion above, I just wanted to point out that you cannot just migrate an existing doom installation to a different directory. You must do a fresh doom install at a non ~/.emacs.d location for this to work.

Thanks for the great tool, @plexus! You've simplified my daily workflow.

@hlissner
Copy link

hlissner commented Sep 19, 2020

In case it's not clear from the discussion above, I just wanted to point out that you cannot just migrate an existing doom installation to a different directory. You must do a fresh doom install at a non ~/.emacs.d location for this to work.

Correction: run <new-doom-location>/bin/doom sync after moving your doom config. No need to reinstall it all.

@cameronwp
Copy link

cameronwp commented Sep 19, 2020

Oh interesting. Something must have been misconfigured on my machine then. When I was trying to migrate, I moved the dir, updated my $PATH to include the new doom location, and ran doom sync. I wound up running into a slew of "package not found" type errors (I believe the packages included but were not limited to "core-utils" (maybe?), "annalist", and "magit-todos"). I also saw weird behavior like M+x doom/reload failing silently Sorry, I can't give more details because I quickly gave up and reinstalled doom from scratch at the new location.

...but I was on my first cup of coffee so I easily could have messed something up 😛

Also, @hlissner, thanks for all your hard work on doom!

@mandarvaze
Copy link
Contributor

mandarvaze commented Sep 19, 2020

@cameronwp @hlissner I had .el files under <new-doom-location>/.local/straight/build/<package> symlinked to ~/.emacs.d/.local/straight/repos/<package>/lisp/<some_file>.el

Since I moved existing doom installation to <new-doom-location> there were no files under new ~/.emacs.d (I think chemacs creates empty .emacs.d) So I was getting "No such file or directory"

Yes, I had run doom sync before which should have addressed the symlinks - I have Sep 5th, 2020 version of DOOM

After @hlissner pointed me to .local/straight/build/ on the DOOM discord channel, I deleted the build folder (Actually I renamed, so that I can restore if required) and then executed doom sync - which got things working for me. 💯

@plexus
Copy link
Owner

plexus commented Sep 21, 2020

Thanks for leaving this info here! If there are things that Doom users in particular should be aware of then we can add those to the README, PRs welcome!

@mandarvaze
Copy link
Contributor

@plexus I'm unclear whether doom sync should have recreated the symlinks in .local/straight/build folders @hlissner can comment.

If doom sync is working as expected, I'll create a documentation PR here for "doom with chemacs" section of the README

@korsmakolnikov
Copy link

It seems doom is not compatible with .emacs file. At least for me, when I run doom it won't start

@mandarvaze
Copy link
Contributor

mandarvaze commented Nov 7, 2020

@korsmakolnikov

It seems doom is not compatible with .emacs file. At least for me, when I run doom it won't start

Can you share your .emacs-profiles.el ?

@Jerror
Copy link

Jerror commented Jan 1, 2021

A very minor quibble, but the name of the config folder (ie DOOMDIR) suggested by the doom docs here for chemacs setup differs slightly from what the chemacs docs suggest is expected.

I glossed over the difference between doom-emacs-config and doom-config and thought for a minute that the rumours that chemacs + doom is broken for the emacs native-comp branch were correct, hah.

@plexus
Copy link
Owner

plexus commented Jan 4, 2021

Feel free to bring our README more in line with the Doom docs, but please do it on Chemacs2.

@AnilJoshi
Copy link

Feel free to bring our README more in line with the Doom docs, but please do it on Chemacs2.

Which one is correct? So the README at Chemacs2 is in line with what is in the Doom docs or not?

Which one should I use?

@plexus
Copy link
Owner

plexus commented Apr 21, 2021

The Doom people should know what is needed, so start from their docs, but make the change on the Chemacs2 repo, and make sure the instructions use chemacs2.

@AnilJoshi
Copy link

I got my setup working. I went through Doom docs.

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

No branches or pull requests

9 participants