On mac, open an Emacs frame in a specific monitor?

Viewed 2559

Background: I use a mac with dual monitor. When I start Emacs, it always opens in the “main” monitor (the one on my macbook pro), which is not the one I want to look at. Is there any elisp function to open a new frame in a specific monitor, so that I can have frames in both monitors after emacs starts?

Or, is there any way to let Emacs starts in the external monitor (if it exists)?

BTW, my Emacs is 24.1.1 from emacsforosx.com.

2 Answers

When I tried the (frame-parameters) approach, it created a strange thing: one window on the primary display and one on the secondary display. However, they were the "same" window, since when I C-x C-c'd one, the other one would get killed as well.

Here is what works for me. I put in my .emacs file. Not sure if you have to set the width and height, but it certainly is a convenient way to do that as well:

(setq default-frame-alist
  '((top + -550) (left + -1800) (width . 108) (height . 60)))
Related