1

Currently I have two versions of Emacs (system installed by apt-get: emacs26 and my own compiled version emacs27). They both us emacs.d directory, and I wonder what happens the packages are incompatible with emacs27. May I use a different .emacs.d" such as.emacs27.d` for only emacs27.

Is it okey to use the same directory for different version of Emacs.

ofenerci
  • 327
  • 1
  • 2
  • 12
  • In order to separate the installation configurations, one option would be to configure `user-emacs-directory` and also the `package-user-dir`. When starting Emacs, it is possible to check the Emacs version and programmatically make decisions on which configurations to load. Depending upon the packages (built-in and add-on), there are other variables that may need to be adjusted to control the location that files will be stored. I keep everything in one main directory (with sub-directories) so that I can back-up and synchronize between machines, along with accessing from a virtual machine. – lawlist Jun 12 '19 at 20:11
  • @lawlist If you would expand your comment a bit on where to set `user-emacs-directory` and `package-user-dir` it would make a great answer. I think for Emacs27 one should set `package-user-dir` in the [early-init.el file](http://git.savannah.gnu.org/cgit/emacs.git/tree/doc/emacs/custom.texi#n2700). – Tobias Jun 12 '19 at 22:25
  • @Tobias -- thank you for mentioning the new `early-init.el` file. When I changed the `user-emacs-directory`, my recollection is that I had to deal with a number of variables that had to be adjusted to make all of my favorite packages store files in my preferred locations. I am not confident that all of the variables rely upon the `user-emacs-directory` as the base; however, it sure would be nice if that were the case. I see an answer to this particular thread as a potential Pandora's Box where the O.P. may have several follow-up questions/problems, and future Google-ers may also need help. – lawlist Jun 13 '19 at 04:55
  • More Reasonable Emacs has builtin supports for multiple versions Emacs, https://github.com/junjiemars/.emacs.d – 南山竹 Jun 13 '19 at 12:57

2 Answers2

1

I was in a similar situation few weeks ago, I wanted to have a fresh emacs instance but still wanted the old emacs around if I needed.

I made a folder called

~/newhome

and when starting emacs I told emacs the home dir is that,

HOME=/Users/administrator/newhome emacs example.txt

Remember to create a .emacs.d in the newhmoe directory too.

american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40
1

If you update packages in Emacs 26 you can use the same .emacs.d directory from Emacs 27.

Drew
  • 75,699
  • 9
  • 109
  • 225