Run several doom configs in parallel, from same repo?

I am about to try to renovate a doom module (helm). I know about chemacs2. Also about DOOMDIR. Is it possible to run several doom emacs configurations (at the same time) from the same doom repo? That would be convenient for A/B testing. But would require separate .local directories. More to the point: What is the recommended method for running different doom versions in parallel (that is: running at the same time), when doing module development?

Since 5b6b204 (~5 days ago), Doom has its own profile system which can replace Chemacs. I’ve documented it lightly in this gist while we wait for more formal documentation. With it you can have multiple Doom configs living off the same Doom installation. E.g.

;; in ~/.emacs.d/profiles.el
((doomemacs1 (env ("DOOMDIR" . "~/.config/doom1")))
 (doomemacs2 (env ("DOOMDIR" . "~/.config/doom2")))
 (doomemacs3 (env ("DOOMDIR" . "~/.config/doom3"))))
  • To launch a specific one: emacs --profile doomemacs2
  • To sync a specific one: doom sync --profile doomemacs2

Thanks, that looks very promising. What luck that you had implemented it just a few days ago! I will have to test it some more, but so far so good. A couple of points:

  • should remind the user to prepend, say, ~/.config/emacs/bin to PATH, otherwise they risk messing up their old doom directory.
  • should also remind the user to not delete their old doom directory, until they have copied over files like .local/cache/{projectile.projects,recentf,savehist,saveplace,sly-mrepl-history} and .local/etc/bookmarks
  • I had success with the profile for doom and prelude, with doom I could even run exwm with emacs as server (daemon). spacemacs seems to require setting more elisp variables, I will try to debug that.

Now I managed to get spacemacs working. In profiles.el the line (spacemacs (user-emacs-directory . “~/.config/spacemacs”) should be (spacemacs (user-emacs-directory . “~/.config/spacemacs/”) i.e. there was a missing terminating ‘/’.

I created a new profile in profiles.el:

(doomemacs (user-emacs-directory . "~/.config/doomemacs")
            (env ("DOOMDIR"       . "~/.config/doomemacs.d")))
(doomhelm (user-emacs-directory . "~/.config/doomemacs")
            (env ("DOOMDIR"       . "~/.config/doomemacs_helm.d")))

I did not create the directory doomemacs_helm.d. I then ran “doom sync --profile doomhelm”. This ran to conclusion but the directory doomemacs_helm.d was not created.

I now created directory doomemacs_helm.d manually, and populated it from ~/.config/emacs/templates

I then ran “doom sync --profile doomhelm” again. This worked! I now have two independent doom profiles, and can run doom sync on each without disturbing the other.

So until the new DOOMDIR is automatically created and populated, I think it should be pointed out in, that one has to do this manually.

doom version info:

GNU Emacs v28.1 nil Doom core v3.0.0-dev fatal: cannot change to ‘~/.config/doomemacs’: No such file or directory Doom modules v22.07.0-dev HEAD → master, origin/master, origin/HEAD d3f2b4d9c 2022-08-01 22:36:33 +0200

Note the strange (but harmless?) message for Doom core.