2

Suppose that the file A.txt is already opened with GNU-emacs, but I don't notice it, so I try opening it (again) with

emacs A.txt

Instead of just showing the already-open window it opens a second one!

(This is of course annoying, since I will end up with 2 conflicting versions.)

How can I avoid this (under ubuntu) ?

sds
  • 58,617
  • 29
  • 161
  • 278

1 Answers1

4

Command emacs starts a new instance of the application.

What you are looking for is emacsclient which connects to an existing emacs instance and tells it to edit the file.

You need to start the server first though.

sds
  • 58,617
  • 29
  • 161
  • 278
  • I started the server using "emacs --daemon" and then I did twice "emacsclient -c A.txt &" but it did open a second window. Am I missing something? – Félix Werner Mar 12 '15 at 18:51