I am working with 2 emacs frames, one on my laptop monitor (1) and the other on a larger external display (2).

Whenever I switch between applications, e.g. between shell and Emacs, the Emacs cursor will be placed on the frame on the laptop, i.e. the smaller screen (1). I then switch by doing C-x 5 o every time, which I'd like to avoid.


It is important to note that the application I switch to, e.g. the shell, is going to be on the small monitor (1). That is to say, I want the primary focus of Emacs to stay on the frame on monitor (2) even when switching to an application on monitor (1) temporarily. The process described in the comments works fine if my frame and the application I switch to are on the same monitor

  • Is there a way to set one frame as the initial / primary one?

I found this question, which seems related but the command in the answer did not work for me. I could not find anything helpful in the man either.

Any pointers are appreciated as I am new to this!

Running emacs 25.3 on Mac OS Sierra 10.12

  • 1
    How please do you switch between applications? Also, are using some type of workspace/OSX thing-a-majig to assign things to the laptop monitor versus the lager external display? I ask these questions, because something like Command+TAB on the Mac should not cause Emacs to change the frame that had imput focus prior thereto. – lawlist Mar 12 '18 at 13:57
  • @lawlist thanks for the feedback! I switch between applications using CMD + TAB. Re some type of workspace/OSX thing-a-majig , I don't think I have any of that -- I plug in the monitor (via VGA / USB-C adapter) and then "extend" my display to it... – patrick Mar 12 '18 at 14:07
  • 1
    I don't have a VGA/USB-C plug to try this with my Macbook, but I did try this experiment with my Mac Pro 2009 running OSX 10.6.8 with two displays. I made the second monitor an extended screen. Then, I launched Emacs 25.3 downloaded from emacsformacosx.com which is a vanilla build with the bare basics. I typed M-x make-frame and dragged the new frame over two the second monitor on the extended display. I placed my cursor in the Emacs frame on the extended (2nd) display. When, I CMD+TAB between something like Firefox and Emacs, the Emacs frame on the extended screen has focus. – lawlist Mar 12 '18 at 16:44
  • @lawlist thank you so much for your detailed analysis! The only difference I can see is the source of emacs and the way you create the frame ( I did the cmd for open file in new frame from an existing frame), and I will recreate your setup now that I know that it works. I really appreciate your help here! – patrick Mar 12 '18 at 18:31
  • @lawlist I re-created your process, except for the new emacs install, and this still does not work for me. I might have to check my settings / emacs. Thanks for all your help! – patrick Mar 13 '18 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.