Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open emacs GUI

Tags:

emacs

There are many guides online to install emacs. They are all the same (like the one I have linked).

sudo apt-get install emacs
emacs testfile        (SUPPOSED to runs the GUI)
emacs -nw testile     (-nw runs emacs in the terminal)

I just installed a fresh copy of Ubuntu 14.04 and installed emacs. When I run emacs testfile it just runs emacs inside the terminal window. I've searched all over online and man emacs but I don't see any information on forcing emacs to use the GUI.

Does anyone know if there is a secret setting or command line option to toggle the default to use GUI vs. terminal mode?

like image 435
Mike S Avatar asked Oct 31 '25 19:10

Mike S


2 Answers

The Ubuntu package emacs is a meta package, which in 14.04 depends on emacs24.

emacs24 is a virtual package provided by emacs24-lucid and emacs24-nox.

From my experience with Ubuntu, emacs-lucid will generally be selected by default, but if you already had emacs-nox installed for some reason, the dependency will already be satisfied, so your apt-get install emacs will not install the graphical version of Emacs.

Also, even if you have the graphical version of emacs installed, it requires the DISPLAY environment variable to be set, to direct it where to display the initial frame. If you are not running your command shell within an X window, or you have used sudo, or some other command that creates a different environment within the shell session, DISPLAY may not be set (you can check with echo $DISPLAY).

like image 182
JSON Avatar answered Nov 04 '25 07:11

JSON


You can install emacs-gtk to have additional GUI support:

sudo apt-get install emacs-gtk
like image 33
Adrian Tompkins Avatar answered Nov 04 '25 08:11

Adrian Tompkins