{"id":22901715,"url":"https://github.com/kitech/dotchemacs2","last_synced_at":"2026-02-15T02:32:42.128Z","repository":{"id":266264447,"uuid":"897713908","full_name":"kitech/dotchemacs2","owner":"kitech","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-03T14:29:36.000Z","size":174,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T15:49:27.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kitech.png","metadata":{"files":{"readme":"README.org","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-03T05:29:47.000Z","updated_at":"2024-12-03T14:36:46.000Z","dependencies_parsed_at":"2024-12-03T12:22:16.560Z","dependency_job_id":"f33a74db-d210-4ed1-a9d1-27d0fae1244e","html_url":"https://github.com/kitech/dotchemacs2","commit_stats":null,"previous_names":["kitech/dotchemacs2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kitech/dotchemacs2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fdotchemacs2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fdotchemacs2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fdotchemacs2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fdotchemacs2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitech","download_url":"https://codeload.github.com/kitech/dotchemacs2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fdotchemacs2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29465717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T01:01:38.065Z","status":"online","status_checked_at":"2026-02-15T02:00:07.449Z","response_time":118,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T01:40:21.415Z","updated_at":"2026-02-15T02:32:42.106Z","avatar_url":"https://github.com/kitech.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+BEGIN_SRC\n       ___           ___           ___           ___           ___           ___           ___\n      /  /\\         /__/\\         /  /\\         /__/\\         /  /\\         /  /\\         /  /\\\n     /  /:/         \\  \\:\\       /  /:/_       |  |::\\       /  /::\\       /  /:/        /  /:/_\n    /  /:/           \\__\\:\\     /  /:/ /\\      |  |:|:\\     /  /:/\\:\\     /  /:/        /  /:/ /\\\n   /  /:/  ___   ___ /  /::\\   /  /:/ /:/_   __|__|:|\\:\\   /  /:/~/::\\   /  /:/  ___   /  /:/ /::\\\n  /__/:/  /  /\\ /__/\\  /:/\\:\\ /__/:/ /:/ /\\ /__/::::| \\:\\ /__/:/ /:/\\:\\ /__/:/  /  /\\ /__/:/ /:/\\:\\\n  \\  \\:\\ /  /:/ \\  \\:\\/:/__\\/ \\  \\:\\/:/ /:/ \\  \\:\\~~\\__\\/ \\  \\:\\/:/__\\/ \\  \\:\\ /  /:/ \\  \\:\\/:/~/:/\n   \\  \\:\\  /:/   \\  \\::/       \\  \\::/ /:/   \\  \\:\\        \\  \\::/       \\  \\:\\  /:/   \\  \\2.0 /:/\n    \\  \\:\\/:/     \\  \\:\\        \\  \\:\\/:/     \\  \\:\\        \\  \\:\\        \\  \\:\\/:/     \\__\\/ /:/\n     \\  \\::/       \\  \\:\\        \\  \\::/       \\  \\:\\        \\  \\:\\        \\  \\::/        /__/:/\n      \\__\\/         \\__\\/         \\__\\/         \\__\\/         \\__\\/         \\__\\/         \\__\\/\n\n                                          222222222222222\n                                         2:::::::::::::::22\n                                         2::::::222222:::::2\n                                         2222222     2:::::2\n                                                     2:::::2\n                                                     2:::::2\n                                                  2222::::2\n                                             22222::::::22\n                                           22::::::::222\n                                          2:::::22222\n                                         2:::::2\n                                         2:::::2\n                                         2:::::2       222222\n                                         2::::::2222222:::::2\n                                         2::::::::::::::::::2\n                                         22222222222222222222\n\n#+END_SRC\n\n* Chemacs\n\nChemacs 2 is an Emacs profile switcher, it makes it easy to run multiple Emacs\nconfigurations side by side.\n\nThink of it as a bootloader for Emacs.\n\n** Differences from Chemacs 1\n\nEmacs intialization used to have a single entry point, either =~/.emacs= or\n=~/.emacs.d/init.el=. More recent Emacsen have introduced a second startup\nscript, =~/.emacs.d/early-init.el=, which runs earlier in the boot process, and\ncan be used for things that should happen very early on, like tweaking the GC,\nor disabling UI elements.\n\nChemacs 2 supports =early-init.el=, Chemacs 1 does not. This does also imply\nthat Chemacs 2 needs to be installed as =~/.emacs.d= (a directory), rather than\nsimply linking it to =~/.emacs= (a single file).\n\n** Rationale\n\nEmacs configuration is either kept in a =~/.emacs= file or, more commonly, in a\n=~/.emacs.d= directory. These paths are hard-coded. If you want to try out\nsomeone else's configuration, or run different distributions like Prelude or\nSpacemacs, then you either need to swap out =~/.emacs.d=, or run Emacs with a\ndifferent =$HOME= directory set.\n\nThis last approach is quite common, but has some real drawbacks, since now\npackages will no longer know where your actual home directory is.\n\nAll of these makes trying out different Emacs configurations and distributions\nneedlessly cumbersome.\n\nVarious approaches to solving this have been floated over the years. There's an\nEmacs patch around that adds an extra command line option, and various examples\nof how to add a command line option in userspace from Emacs Lisp.\n\nChemacs tries to implement this idea in a user-friendly way, taking care of the\nvarious edge cases and use cases that come up.\n\n** Alternatives\n\n- Emacs 29 introduces [--init-directory](https://git.savannah.gnu.org/cgit/emacs.git/log/?qt=grep\u0026q=init-directory)\n- [with-emacs.sh](https://github.com/alphapapa/with-emacs.sh) Emacs sandboxing shell script, works by adding a number of `--eval` flags to Emacs startup.\n\n** Installation\n\nClone the Chemacs 2 repository as =$HOME/.emacs.d=. Note that if you already\nhave an Emacs setup in =~/.emacs.d= you need to move it out of the way first. If\nyou have an =~/.emacs= startup script then move that out of the way as well.\n\n#+BEGIN_SRC shell\n  [ -f ~/.emacs ] \u0026\u0026 mv ~/.emacs ~/.emacs.bak\n  [ -d ~/.emacs.d ] \u0026\u0026 mv ~/.emacs.d ~/.emacs.default\n  git clone https://github.com/plexus/chemacs2.git ~/.emacs.d\n#+END_SRC\n\nNote that this is different from Chemacs 1. Before Chemacs installed itself as\n=~/.emacs= and you could have your own default setup in =~/.emacs.d=. This\napproach no longer works because of =~/.emacs.d/early-init.el=, so Chemacs 2\nneeds to be installed as =~/.emacs.d=.\n\nNext you will need to create a =~/.emacs-profiles.el= file, for details see\nbelow.\n\n#+begin_src emacs-lisp\n  ((\"default\" . ((user-emacs-directory . \"~/.emacs.default\"))))\n#+end_src\n\n** Usage\n\nChemacs adds an extra command line option to Emacs, =--with-profile=. Profiles\nare configured in =~/.emacs-profiles.el=.\n\nIf no profile is given at the command line then the environment variable\nCHEMACS_PROFILE is used. If this environment variables isn't set then the\n=default= profile is used.\n\n#+BEGIN_SRC shell\n$ emacs --with-profile my-profile\n#+END_SRC\n\nThere is an option for using profile that is not preconfigured in =~/.emacs-profiles.el=. To accomplish that you can directly provide the profile via the command line, like so\n#+BEGIN_SRC shell\n$ emacs --with-profile '((user-emacs-directory . \"/path/to/config\"))'\n#+END_SRC\nThis method supports all the profile options given below.\n\n** .emacs-profiles.el\n\nThis file contains an association list, with the keys/cars being the profile\nnames, and the values/cdrs their configuration.\n\nThe main thing to configure is the =user-emacs-directory=\n\n#+BEGIN_SRC emacs-lisp\n  ((\"default\" . ((user-emacs-directory . \"~/.emacs.default\")))\n   (\"spacemacs\" . ((user-emacs-directory . \"~/spacemacs\"))))\n#+END_SRC\n\nChemacs will set this to be the =user-emacs-directory= in use, and load\n=init.el= from that directory.\n\nOther things you can configure\n\n- =custom-file= : The file where Customize stores its customizations. If this\n  isn't configured, and the =custom-file= variable is still unset after loading\n  the profile's =init.el=, then this will get set to the profile's =init.el=\n- =server-name= : Sets the =server-name= variable, so you can distinguish multiple\n  instances with =emacsclient -s \u003cserver-name\u003e=.\n- =env= An association list of environment variables. These will get set before\n  loading the profile, so they can influence the initialization, and they are\n  visible to any subprocesses spawned from Emacs.\n- =straight-p= Enable the [[https://github.com/raxod502/straight.el][Straight]]\n  functional package manager.\n- =nix-elisp-bundle= A directory containing elisp dependencies bundled by the\n  nix package manager. The bundle path can be produced by nix using an\n  expression like =(emacs.pkgs.withPackages (p: [ p.avy … ])).deps=.\n  Because the bundle path is in the nix store, if it is specified\n  in =.emacs-profiles.el= then that file should also be maintained by\n  nix, to prevent the path from being garbage-collected.\n  Alternatively, a nix-generated script or alias could specify\n  =nix-elisp-bundle= as a command-line argument.\n\nStore =.emacs-profiles.el= together with your dotfiles. If you're not yet keeping\na version controlled directory of dotfiles, then check out\n[[https://github.com/plexus/dotfiles/blob/master/connect-the-dots][connect-the-dots]]\nfor a helpful script to do that.\n\n** Changing the default profile (e.g. for GUI editors)\n\nWhere it is not possible to use the =--with-profile= flag or the CHEMACS_PROFILE\nenvironment variable, the default profile can be set using a =~/.emacs-profile=\nfile.\n\nIf your =~/.emacs-profiles.el= file contains the following:\n\n#+BEGIN_SRC emacs-lisp\n  ((\"default\" . ((user-emacs-directory . \"~/.emacs.default\")))\n   (\"spacemacs\" . ((user-emacs-directory . \"~/spacemacs\")))\n   (\"prelude\" . ((user-emacs-directory . \"~/prelude\"))))\n#+END_SRC\n\nyou can create a file called =~/.emacs-profile=, containing the name of the\nprofile you'd like to be used when none is given on the command line:\n\n#+BEGIN_SRC shell\n$ echo 'spacemacs' \u003e ~/.emacs-profile\n#+END_SRC\n\nThis will set the default profile to be the \"spacemacs\" profile, instead of\n\"default\". You can change the default by simply changing the contents of this\nfile:\n\n#+BEGIN_SRC shell\n$ echo 'prelude' \u003e ~/.emacs-profile\n#+END_SRC\n\nIf this file doesn't exist, then \"default\" will be used, as before.\n\n** Spacemacs\n\nSpacemacs is typically installed by cloning the Spacemacs repo to =~/.emacs.d=,\nand doing extra customization from =~/.spacemacs= or =~/.spacemacs.d/init.el=.\nThis makes it tedious to switch between version of Spacemacs, or between\ndifferent Spacemacs configurations.\n\nWith Chemacs you can point your =user-emacs-directory= to wherever you have\nSpacemacs installed, and use the =SPACEMACSDIR= environment variable to point at\na directory with customizations that are applied on top of the base install.\n\n#+BEGIN_SRC emacs-lisp\n((\"spacemacs\" . ((user-emacs-directory . \"~/spacemacs\")\n                 (env . ((\"SPACEMACSDIR\" . \"~/.spacemacs.d\")))))\n\n (\"spacemacs-develop\" . ((user-emacs-directory . \"~/spacemacs/develop\")\n                        (env . ((\"SPACEMACSDIR\" . \"~/.spacemacs.d\")))))\n\n (\"new-config\" . ((user-emacs-directory . \"~/spacemacs/develop\")\n                  (env . ((\"SPACEMACSDIR\" . \"~/my-spacemacs-config\"))))))\n#+END_SRC\n\n** DOOM emacs\n\nYou can add an entry similar to the following to your =.emacs-profiles.el=\n\nIn the following snippet =~/doom-emacs= is where you have cloned doom emacs.\n\n(Depending on when you read this) =DOOMDIR= support is only in =develop= branch of doom emacs. Check commit history of =master= branch of doom emacs\n\n#+BEGIN_SRC emacs-lisp\n(\"doom\" . ((user-emacs-directory . \"~/doom-emacs\")\n           (env . ((\"DOOMDIR\" . \"~/doom-config\")))))\n#+END_SRC\n\nPlease refer to [[https://github.com/plexus/chemacs/issues/5][this]] discussion for details.\n\n** FreeDesktop Directories\n\nBoth =~/.emacs-profiles.el= and =~/.emacs-profile= can also be stored under =$XDG_CONFIG_HOME/chemacs= (typically =~/.config/chemacs=) as =$XGD_CONFIG_HOME/chemacs/profiles.el= and =$XDG_CONFIG_HOME/chemacs/profile= respectively.\n\nFurther, as indicated by the [[http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-27][Emacs 27.1 changelog]], Emacs is now compatible with XDG Standards, looking for its configuration files in =${XDG_CONFIG_HOME}/emacs= directory too (provided the traditional =~/.emacs.d= and =~/.emacs= does not exist).\nTherefore, it is perfectly viable to install Chemacs 2 in =${XDG_CONFIG_HOME}/emacs= (usually =~/.config/emacs=) directory - with the aforementioned caveat: _the directory =~/.emacs.d\"= and the file =\"~/.emacs\"= does not exist_.\n\n** Example: emacs as daemon\n- Profiles\nYou can add an entry similar to the following to your =.emacs-profiles.el=\n#+BEGIN_SRC emacs-lisp\n;; your custom or vanilla emacs profile\n((\"default\" . ((user-emacs-directory . \"~/.gnu-emacs\")\n\t       (server-name . \"gnu\")\n\t       ))\n\n;; emacs distribution: DOOM-emacs\n(\"doom\" . ((user-emacs-directory . \"~/.doom-emacs\")\n\t   (server-name . \"doom\")\n\t   (env . ((\"DOOMDIR\" . \"~/.doom.d\")))\n\t     ))\n  )\n#+END_SRC\n\n- daemon\nSet emacs daemon to always run in background\n#+begin_src bash\n# vanilla\nemacs --daemon \u0026\n# Doom emacs\nemacs --with-profile doom --daemon \u0026\n#+end_src\n\n- emacsclient\ncreate a new frame, connect to the socket and use vanilla emacs as fallback\n#+begin_src bash\nemacsclient -c -s gnu -a emacs\nemacsclient -c -s doom -a emacs\n#+end_src\n\n** Troubleshooting\n\n*** Emacs cannot find packages installed by straight\nSome users have [[https://github.com/plexus/chemacs2/issues/31][reported issues]] where packages installed by `straight.el` can no longer be found after switching to using `chemacs`.\n\nFirst, make sure you haven't hardcoded filepaths to \"emacs.d\" in your configuration. You should reference files inside a profile-specific emacs folder like this:\n\n#+begin_src elisp\n(setq some-var (expand-file-name \"path/to/file\" user-emacs-directory))\n#+END_SRC\n\nSecond, if the issue persists you should delete the `build` folder in your `straight` directory and rebuild your dependencies.\n\nIf the issue persists please [[https://github.com/plexus/chemacs2/issues/31][comment on the issue]], because we are still trying to figure out the exact source of this problem, but this has solved the problem for some users.\n\n** LICENSE\n\nCopyright © Arne Brasseur and contributors, 2018-2022\n\nDistributed under the terms of the GPL v3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitech%2Fdotchemacs2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitech%2Fdotchemacs2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitech%2Fdotchemacs2/lists"}