plexus / chemacs

Emacs profile switcher
652 stars 45 forks source link

Environment Variable #15

Closed ofenerci closed 5 years ago

ofenerci commented 5 years ago

Hello, I wonder Env. variable could be applied for ordinary Emacs( I have different version of Emacs and each version has its own config files.) For example:

("emacs27" . ((user-emacs-directory . "~/.emacs27.d")
        (env . (("EMACSDIR" . "~/Personal/dotfile/emacs27"))))

In the document, it is mentioned there are env. variable Spacemacs and Doom Emacs.

plexus commented 5 years ago

env is not specific to Spacemacs or Doom, you can use it regardless of your setup.

https://github.com/plexus/chemacs#emacs-profilesel

  • env An association list of environment variables. These will get set before loading the profile, so they can influence the initialization, and they are visible to any subprocesses spawned from Emacs.
ofenerci commented 5 years ago

Hello, What is my understanding from the document: user-emacs-directory: This is directory where I download packages (Elpa packages, etc.) "EMACSDIR" is where you put your configuration files( init.el).

What I would like to do: a) My emacs27 package installation (installing from elpa) should go to the .~/emacs27.d directory. b) My init.el file should be read from "~/Personal/dotfile/emacs27

plexus commented 5 years ago

user-emacs-dir is where you put your init.el

ELPA packages are installed in package-user-dir

There is no such thing as EMACSDIR.

ofenerci commented 5 years ago

I understand now. But what is the reason have environment variable. You could give a concrete example how to use it.

plexus commented 5 years ago

The reason is that sometimes you need it, there are two examples in the README, SPACEMACSDIR and DOOMDIR. Environment variables are a generic unix concept that's been around for decades, generally people who need that feature will know they do. The rest can ignore it.