Emacs on OS X El Cap is version 22. MacPorts version is 24.
$ sudo port install emacs
then
$ cd ~
$ emacs .bash_profile
paste in:
# Use the up-to-date MacPorts emacs
alias emacs='/opt/local/bin/emacs'
# For our chording coding friends
export EDITOR=/opt/local/bin/emacs
you’re done. Consider portsUpdate to keep it up-to-date daily.