8

I have Ubuntu 12.04 running with Emacs 24.3. On computer startup, emacs --daemon is executed, and I have modified the emacs24.desktop to take emacsclient -c -a "" as exec parameter. However, whenever I try to open a file a new frame opens every time.
Is there a way to make the file appear in a preexisting frame as a new buffer?

By “open a file” I mean using either GUI file manager or using terminal by emacsclient -nc [filename] or emacsclient -nc -a "" [file].

EDIT: What seems to be happening is that emacs is opening a new "OS window" (as in Emacs frame) with every file; however, I am able to access all the buffers in the same emacs frame. Still, having multiple emacs frames in irritating even though I don't have to switch through them. Closing the frame manually removes the buffer too.

Is there a way to suppress the behavior of opening the new frame every time?

strNOcat
  • 211
  • 2
  • 7
  • What is the "-nc" option you have in your commandline. I see "-nw", "-c", "-n" but no "-nc" option when I do `emacsclient -help`. – Kaushal Modi Sep 28 '14 at 14:33
  • `-n` is for `no-wait` while `-c` was to create new frame (I didn't realized it created new frame _every_ _time_). Without `-c`, `emacsclient` starts emacs in the `-nw` mode for some reason. – strNOcat Sep 28 '14 at 19:13
  • 1
    Yes, but I am not sure if -n and -c can be merged into -nc. – Kaushal Modi Sep 28 '14 at 19:26
  • It gives the same behavior. But yes, that was careless on my part; thanks. – strNOcat Sep 29 '14 at 03:58

1 Answers1

9

Your included option of -c is causing this. Per the man page,

-c, --create-frame create a new frame instead of trying to use the current Emacs frame.

Remove this option from your command and Emacs should refrain from creating a new frame (AKA Window).

Malabarba
  • 22,878
  • 6
  • 78
  • 163
Andy
  • 398
  • 2
  • 6