4

I currently have emacs 24.5.1 running on OSx el capitan. Since the first RC of emacs 25.1 released a few days ago, I am very curious to try it out. Can I have both versions installed on the same machine without causing any conflicts ?

Also, can I use most of the packages I used for emacs 24 with emacs 25 without any major problems? or would I need to wait for some packages to have emacs 25 support ?

Edit: I used homebrew to install emacs 24.

  • If you are building your own from source --with-ns or just downloading the entire Emacs.app from emacsformacosx.com, then all you need to do is go to the /Applications folder and change the name of Emacs.app to Emacs_version123.app. Then download and copy to the /Applications folder the other version, and change the name of the second installation if you want. For using Emacs in the terminal, the path to the executable will of course change depending upon which version you use. If you are using Homebrew or Macports, then please edit your question as the answers will vary. – lawlist Aug 5 '16 at 20:32
  • edited the question. – Chakravarthy Raghunandan Aug 6 '16 at 5:35
2

In Windows it is easy: you need to set two distinct $HOME folders to host the packages.

For OSX the process should be as follows.

After installing Emacs 24 and 25, in distinct folders, create two folders: home24 and home25.
Create two scripts, run24:

#!/bin/sh
export HOME=path/to/home24
/path/to/24/emacs 

and run25:

#!/bin/sh
export HOME=path/to/home25
/path/to/25/emacs 

Adjust the folder paths as needed.

Now, when you run run24, you start the Emacs 24 binary, which will use path/to/home24/.emacs.d for storing packages; while run25 will use path/to/home25/.emacs.d

Update

Can you keep/share the same init file and configuration folders?

There is no straight answer to this question.

Since there are tons of open source packages, the Emacs developers do not introduce changes in new releases that break the previous ones, but they instead use deprecation.
That is, Emacs just warns you, but still lets you use the deprecated commands. For example, sharing the polymode package (from Emacs 24), I got:

share/emacs/site-lisp/polymode/polymode-classes.el: ‘defmethod’ is an obsolete macro (as of 25.1); use ‘cl-defmethod’ instead.
share/emacs/site-lisp/polymode/polymode-classes.el: ‘defgeneric’ is an obsolete macro (as of 25.1); use ‘cl-defgeneric’ instead.

which are in fact just warnings.

This is the theory. In my practice, after upgrading, Emacs occasionally failed to start or some packages failed to work an I had to fix my init file and/or upgrade some packages to have the whole system working.

Your mileage may vary as actual results depends on how complex is your init file, how often do you maintain it, how many packages do you have and how supported they are.

  • I already am running emacs 24 installed using homebrew. I do not want to reinstall my whole config again in a separate folder. Can I keep my installation of emacs 24 as it is and try the above method ? – Chakravarthy Raghunandan Aug 6 '16 at 6:29
  • @ChakravarthyRaghunandan: See updated answer – antonio Aug 6 '16 at 15:21
2

I use MS Windows, with prebuilt Emacs binaries. Unlike what @antonio says, I have a single HOME environment variable, and its location has nothing to do with Emacs.

I create a Windows shortcut to the runemacs.exe file for a given Emacs release. I have dozens and dozens of Emacs builds on my laptop, and I have shortcuts to about a dozen of them.

I use this kind of address for a typical Emacs shortcut Target:

D:\my-path-to-some-Emacs-build\bin\runemacs.exe --debug-init "d:\my\startup\folder"

And I use this as the value of field Start in:

d:\my\startup\folder

(I start Emacs in Dired for that folder.)

To start Emacs I double-click such a shortcut. Or if it is on the task bar then I single-click it there.

  • I also use emacs 24 and 25 on windows and linux, without a problem. However, I always compile el files using emacs 24, depending on backward compatibility of byte-code. See here for some information given in a stackexchange question. – theldoria Aug 6 '16 at 18:35
  • @theldoria: Are you talking about your own and 3rd-party *.el files, or are you talking about those that are part of Emacs. For the latter, just compile with the same release. For the former, things are actually more complicated that that linked page indicates. Byte compatibility was broken between several minor releases. – Drew Aug 7 '16 at 1:28
  • I talked about 3d party *.el files. Is use different emacs versions for testing only, before switching to a newer one. As you pointed out, this may or may not work between different versions and should probably not done in production. – theldoria Aug 7 '16 at 7:00
1

You can have as many versions installed at the same time without conflicts. Also, backward compatibility is generally maintained (with a few rare exceptions and modulo bugs, of course), so normally you can use in Emacs-25 all the packages you used in Emacs-24.

Forward compatibility is generally not maintained, so be careful that if you byte-compile a package with Emacs-NN it's likely that it won't work with an older Emacs. Byte-compilation is performed for example when you install via package.el, so better install with the older Emacs rather than the newer one.

  • before I install emacs 25, how would I manage my .emacs file now that there are two versions of emacs ? Can I have two separate .emacs file for 24 and 25 ? – Chakravarthy Raghunandan Aug 6 '16 at 15:08
  • Why not use the same ~/.emacs? It should work just as well. – Stefan Aug 6 '16 at 15:16
  • Thanks for clearing things up. I installed emacs 25 and it works like a charm :) – Chakravarthy Raghunandan Aug 6 '16 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.