Install Emacs 25.0 on MacOSX

I am using Homebrew on my MacBook to install Emacs, the setup works fine and is easy to maintain. Just install it with this command:

$ brew install emacs --HEAD --use-git-head --cocoa --srgb

To get Emacs into Application folder I use:

$ brew linkapps

Now you can start Emacs in graphical mode from Applications folder, but for command line it still is the MacOSX version:

$ emacs --version
GNU Emacs 22.1.1
Copyright (C) 2007 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

To solve this you just add an alias to your ~/.profile file:

alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs -nw"

Either you start a new terminal or source the .profile file to load the alias, or just issue the alias command, then:

$ emacs --version
GNU Emacs 25.0.50.1
Copyright (C) 2015 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.