10
votes

just switched from single to dual monitors

have managed to utilise both screens with emacs by using C-x 5 f to open a file in a buffer in a new frame, i can drag that frame on to the 2nd monitor and enjoy my extra real-estate

Prob I now have is how to efficiently switch between buffers in different frames

I'm used to using C-x o to switch between buffers in a split frame on a single monitor but this doesn't work for multiple frames

Having to use the more cumbersome C-x 5 b <buf-name> which is painful in comparison

Anyone have any top-tips on how to make buffer switching more efficient across dual monitors?

Ideally I would like to cycle across all buffers using a single simple keyboard shortcut regardless of frames

4
what behavior, specifically, are you looking for? - jtahlborn
do you just want C-x o to cycle across all visible buffers across all visible frames? if so, i think you probably just want to bind that keybinding to (other-window 0 'visible). - jtahlborn
yes - i think thats exactly what i'm after, will give it a try - bph

4 Answers

8
votes

I'd expect C-x 5 o to switch to the other frame, tho I don't have such a dual-screen setup to verify.

5
votes

With separate frames, I use the following to get mac osx style "same-app" switching with cmd-backtick. If you're on linux / windows you could do the same thing with alt-tilda:

(defined-key global-map (kbd "M-`") 'other-frame)

I like this because it keeps the action of switching frames separate from switching buffers. With multiple screens, it's usually some kind of context switch when you want to change which one has focus.

4
votes

Turning my comment above into an answer as it seems to be what the OP is after:

(defun other-window-visible ()
  (interactive)
  (other-window 0 'visible))
(global-set-key "\C-xo" 'other-window-visible)
2
votes

Maybe

(global-set-key (kbd "C-x o") 'next-multiframe-window)

(Though as spike mentioned, I think keeping C-x o bound to other-window and binding next-multiframe-window to something different makes sense.)