Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In file explorer (Nautilus) under Ubuntu, I can select a file and right click and scroll to:

open with other application

My question is how can I add emacs to that list of "other application"

share|improve this question
Which emacs package do you have installed? Also, what type of file are you expecting to see this on? – dobey Apr 19 '13 at 17:42
up vote 2 down vote accepted

After we had installed emacs Install emacs we may not yet have a .desktop file to integrate it with the desktop environment.

We then can copy the emacs23.desktop file if located in /usr/share/applications or we can create a custom emacs.desktop file in ~.local/share/application, e.g. with the following content (add further options at your needs).

[Desktop Entry]
Name=Emacs 23
Exec=/usr/bin/emacs23 %F

We can then select Emacs in the list of "Open With Other Applications -> Show other applications" on right click of a file with a content we want to associate Emacs with.

enter image description here

After having selected the now present Emacs (note that there is no icon defined yet if using a custom dektop file, give the path to an icon in your emacs.desktop above) we can then choose to "Open with Emacs" in the Nautilus context menu:

enter image description here

To undo this we simply right click on the Emacs entry in the menu that pops up after having selected "Open With Other Application..." and say "Forget association":

enter image description here

share|improve this answer
Thanks for the answer - I couldn't get this working before. I was missing the %F flag in my emacs.desktop file. – metakermit May 18 '13 at 13:46

I use emacs-snapshot available here (the latest release, good if you want to extend your environment with additional packages) and this is my ~/.local/share/applications/emacs-snapshot.desktop entry that adds files into the existing emacs instance as a new buffer instead of creating a new window every time (way faster and you can easily switch using C-x b - even cooler with IDO-mode enabled).

[Desktop Entry]
Comment=GNU Emacs Snapshot Client
Exec=/usr/bin/emacsclient.emacs-snapshot -a 'emacs' %F

Note that for emacsclient to work, you need to have this in your ~/.emacs configuration file:

(load "server")
(unless (server-running-p) (server-start))
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.