I like to use emacs as my configuration editor, so it is the default for programs like git or cron. So I used

sudo update-alternatives --config editor

And chose emacs24 from the list.

Unlike Vim or nano, this launches emacs as a new gui application, rather than taking over the current terminal window.

Is there a way to make emacs open in the terminal as a configuration editor, or maybe when it is invoked from the command line, but still allow for launching emacs as a stand-alone application from the launcher or dash?

4 Answers
4

Most utilities, including git respect an environment variable named EDITOR which you can set to any editor you want, including options. export EDITOR='emacs -nw' will have them run emacs in non windowed mode.

In the case of emacs, it has a handy server mode you can start with M-x server-start and then run emacsclient as an editor to open a file in the already running emacs instance. This is handy since it allows you to retain access to the emacs kill ring and other features. It also accepts the -nw switch so that it will open a new emacs frame in the terminal window rather than in the gui emacs frame, so it will still look and feel like a text mode emacs session, but still share the kill ring and buffers with the other window(s).