vfclists · 2022-09-30 12:39
The problem with updating, upgrading and syncing Doom profiles is that you need to ensure that the `~/.doom.d` and the path to `bin/doom` for the profiles do not conflict in your shell and I had to do some experimentation using `~/.emacs-profiles.el` and `~/.doom.d/init.el` to get this approach working.
It is based on the idea that when managing your Doom installation with the `doom sync`, `doom build` etc commands you run the commands in `vterm` or `term` sessions from the same Chemacs2 session.
You might consider this post an attempt to get others to find any bugs in my approach as I just got it working and the _it works on my system_ caveat applies.
**Settings in `~/.emacs-profiles.el`**
("doom01" . ((user-emacs-directory . "~/config/emacs/profiles/doom01/doom")
(env . (("DOOMDIR" . "~/config/emacs/profiles/doom01/config")
("DOOMPATH" . "~/config/emacs/profiles/doom01/doom/bin")
("CHEMACS2PROFILE" . "doom01")
))
))
**Command in `$DOOMDIR/init.el`**
(setenv "PATH" (concat (expand-file-name (getenv "DOOMPATH") "") ":" (getenv "PATH")))
The `setenv` command in the Doom config's `init.el` sets the path to `bin/doom` in that profile and `~/.doom.d` is automatically taken care of by `DOOMDIR`.
With the `$PATH` variable including the path to the relevant `bin\doom` `vterm` and `term` inherit them automatically and the `doom xxxx` commands work as expected.
The values in `~/.emacs-profiles.el` and that command in `init.el` are the sole source of truth for mantaining that Doom installations. You don't need to set environment variables or paths anywhere else.
noncogs · 2022-09-30 13:45
I don’t think there’s going to be a way using Chemacs without a script. Doom does have profile capabilities itself, maybe that’s worth looking into. I use Chemacs but not for multiple Doom profiles, just for regular EMacs and Doom. If you’re a rofi user, I basically wrote a rofi front end for Chemacs. It’s called rofi-chemacs on GitHub. The README needs rewritten, but all the information is there and it’s fully functional. I use it every day. All of your modifications to your Chemacs configs should directly carry over to it, if you decide to use it. It would give you a nice launcher and manager of your profiles and daemons without launching from the command line. Perhaps you or I can add further support or look deeper into what you’re doing if you end up using it. It’s my solution for using Chemacs without the command line.
Edit: [rofi-chemacs](https://github.com/noncog/rofi-chemacs)
vfclists · 2022-09-30 15:10
This still depends on Chemacs2 and works with the basic `emacs --with-profile profilename` command that Chemacs2 starts emacs profiles with.
The idea is to able to run the `doom xxxx` commands for each profile without setting the `bin\doom` paths in the environment. You can have as many doom installations as you like and the `bin/doom` and `~/.doom.d` values will never conflict as they are run within the profiles `vterm` and `term` environments.
noncogs · 2022-09-30 15:26
I see. Although that is what you asked for in the title it’s not what you asked for in the body. Either way, I have useful steps in the right direction. It’s possible to set environment variables only within the context of a shell script’s execution. They’re not set globally in your environment and they go away after. Create a wrapper script called doom, add it to your path, in that set your environment variables based on some indicator of which profile you’re using and then call the appropriate doom command. This allows you to use your profiles and the doom command normally and your script handles the sensing of which installation/configuration to work on. Thus you’ve made an in between layer that does what you want without using global environment variables or requiring a launcher script.
vfclists · 2022-09-30 15:42
That is the problem with Reddit titles. If you don't think them through you can't change them again, and deleting one with the wrong title and creating a better title makes it look like spamming.