Emacs switches to the next window regardless of frame

I would like the Cx o command (next window) to include windows in other frames, as well as windows in the current frame.

Does anyone know how to do this? Is there any other command I should use? Is there any piece of elisp magic that can do this with ease?

+6
source share
7 answers

Cx o other-window . To go to another frame, use Cx 5 o , which is another other-frame .

+4
source

Not sure if this is what you mean, but if you just want to cycle through the buffers in the buffer list , regardless of frame:

Ctrl x

Ctrl x

They are bound to the next buffer and (previous buffer), respectively.

+1
source

This may be a first approximation. http://www.gnu.org/software/emacs/manual/html_node/elisp/Cyclic-Window-Ordering.html
http://www.gnu.org/software/emacs/manual/html_node/elisp/Frames.html

other-window has a parameter to control how it works with frames.

 (global-set-key (kbd "Cx o") (lambda () (interactive) (other-window 1 t) (let ((nframe (window-frame (selected-window)))) (select-frame-set-input-focus nframe) (make-frame-visible nframe)))) 
+1
source

You must press Cx 5 o Ch to see all the functions for working with frames.

Some of these functions are other frames.

+1
source

I am using version 2.0 of ace-jump mode. It takes about two minutes to understand how this works, and since version 2.0 it allows you to "switch" to another frame. You can go to any character from any buffer / frame / window that you can see on the screen with three or four keystrokes. It is very difficult to win.

This is a huge time saver, so I would recommend checking it out because it is really convenient.

http://www.emacswiki.org/emacs/AceJump

And "Emacs Rocks! Episode 10: Jumping Around," two minutes showing him in action:

http://www.youtube.com/watch?v=UZkpmegySnc

+1
source

From Ch f next-window :

(next window and optional WINDOW MINIBUF ALL-FRAMES) ...

ALL-FRAMES nil or omitted means that all windows are on the WINDOW frame, as well as the minibuffer window, if it is specified by the MINIBUF argument. If the minibuffer is counting, consider all windows on all frames that also use this minibuffer. The following non-zero ALL-FRAMES values ​​have special meanings:

  • t means looking at all windows in all existing frames.

  • `visible 'means viewing all windows in all visible frames.

  • 0 (number zero) means viewing all windows in all visible and marked frames.

  • A frame means looking at all the windows for that frame only.

Anything means that all the windows on the WINDOW frame are different.

Somewhat ironically, other-window also supports this, as it uses next-window . Unfortunately, I don't know a way to pass non-numeric arguments interactively, but a simple function should do the trick:

 (defun my-other-window (count) (interactive "p") (other-window count t)) 
+1
source

You say: "Is there a way to cycle through windows, no matter what frame they are in? Is this really what I'm looking for?"

Yes, there are icicles .

What you are asking for is the icicle-select-window command when you use the arg prefix. If you want this behavior always, you can define your own command that does this without the arg prefix:

  (defun my-select-window () "Select window by name. Windows of all visible frames are candidates." (interactive) (let ((current-prefix-arg 1)) (icicle-select-window))) 

You will be prompted for a window name. But if you just want to cycle, without narrowing down the candidates, by typing part of the name, just use C-down to get the window you want.

(The window name is the name of the displayed buffer, but the suffix as required [NUMBER] to make the name unique. For example, if you have two windows with the *Help* buffer, one of the windows will be called *Help*[2] for use with this team.)

0
source

Source: https://habr.com/ru/post/921519/


All Articles