Installing Emacs on FreeBSD
To install the latest development version of Emacs, with all the latest features, there are two approaches: using a pre built package or building from the ports.
To fetch and install the package run:
# pkg_add -r emacs-devel
Or use the ports:
# cd /usr/ports/editors/emacs-devel # make install
Using Emacs as a Development Environment from the official FreeBSD project documentation. Some of the config tweaks are a bit dated and might need updating. But overall it's a good starting point.