Mac OS X Sierra 10.12.5 already has an old version of emacs installed to /usr/bin/emacs and it can't be removed.
You used to be able to rename the files from
emacs22, so that when you install another version they wouldn't conflict. Good in theory, but in El Captain and newer, Apple have changes the security on the file system
This used to work:
sudo mv /usr/bin/emacs/emacs22 sudo mv /usr/bin/emacsclient emacsclient22 sudo mv /usr/bin/emacs-undumped emacs22-undumped
So, instead I'm going to install macports.
Firstly, Install MacPorts for Mac OS X Sierra 10.12.5 and install the downloaded package by double clicking on the downloaded
MacPorts required the xcode command line tools. Install this next:
xcode-select --install sudo port install emacs
This solves my problem because the
/opt/local/bin/ path is searched before the
/usr/bin/ path, so anything in the
opt path will take precedence over
/usr/bin and I don't need to uninstall emacs 22.
Now let's see which emacs is run:
osx:~$ which emacs /opt/local/bin/emacs osx:~$ emacs --version GNU Emacs 25.2.1