Make emacs run in console mode (-nw) by default
This answer suggests the method I found works best for me (was having problems with aliases). Essentially, create an executable script
#!/bin/sh
emacs -nw "$@"
and point $EDITOR
to it in your shell rc file.
In case you decide to use emacs in terminal mode always, install emacs-nox (emacs with no X support).
After installationis still ran by $ emacs so you no need to create aliases again!:)
Its there in repos of Debian Squeeze so must be in Ubuntu also.
On my Debian testing, alias emacs='emacs -nw'
followed by emacs
opens Emacs in the terminal. And, in the same session, emacs23-x
opens Emacs with the GUI.