4

windows 10, emacs 26.1

I open 4 frames. How I can quick switch between them?

I need smt like this:

C-1 -> switch to frame#1

C-2 -> switch to frame#2

and so on.

I use ace-window but it not very compfortable because:

1. Create frame#1 
 2. split it to 2 windows
 3. create frame#2
 4. split it to 3 windows
 5. create frame#3
 6. On screen visible only one frame (e.g. frame#2)

And now try to quick switch between frames. It very hard. Ace-windows show me 6 numbers (1,2,3,3,4,5,6). And how I select quick desire frames? It's hard.

  • ace-window might be what you want. See github.com/abo-abo/ace-window – andrej Nov 29 '18 at 9:59
  • No. I use it but when many frames it's not comfortable. – a_subscriber Nov 29 '18 at 10:00
  • 1
    I am using a combination of ace-window and eybrowse. It allows you to have several workspaces in one frame. See for instance here for the description of eybrowse manuel-uberti.github.io/emacs/2017/08/06/eyebrowse – andrej Nov 29 '18 at 10:09
  • 3
    Does other-frame work under Windows? I have that bound to C-`, it allows cycling between frames. – rpluim Nov 29 '18 at 10:53
  • Work. but it's not comfortable. Suppose I open 5 frames.I need to use at least "other-frame" any times to select desire frame. It's to hard. – a_subscriber Nov 29 '18 at 11:02
2

I use switch-window. When switching windows, it labels each window with a key and then prompts for which one you want. There are several options, but I prefer to use the home row for the labels.

switch-window

You can use (setq switch-window-multiple-frames t) to have it span multiple frames.

My init.el looks like:

(use-package switch-window
  :ensure t
  :bind
  ;; default C-x o is other-window
  ;; default C-x C-o is delete-blank-lines
  (("C-x o" . switch-window)
   ("C-x C-o" . switch-window))
  :config
  (setq switch-window-multiple-frames t)
  (setq switch-window-shortcut-style 'qwerty)
  ;; when Emacs is run as client, the first shortcut does not appear
  ;; "x" acts as a dummy; remove first entry if not running server
  (setq switch-window-qwerty-shortcuts '("x" "a" "s" "d" "f" "j" "k" "l" ";" "w" "e" "r" "u" "i" "o" "q" "t" "y" "p"))
  (setq switch-window-increase 3))

A minimal setup would look like:

(require 'switch-window)
(global-set-key (kbd "C-x o") 'switch-window)
(setq switch-window-multiple-frames t)

Minimal setup with multiple frames

1

If you use Icicles then you can quickly select a frame by its name, with completion, using multi-command icicle-select-frame:

icicle-select-frame is an interactive compiled Lisp function in icicles-cmd1.el.

It is bound to C-x 5 o.

(icicle-select-frame)

Select frame by its name and raise it.

A frame name in this context is suffixed as needed by [NUMBER], to make it unique. For example, in a context where frames are named for their buffers and you have two frames showing buffer *Help*, one of the frames will be called *Help*[2] for use with this command.

Read input, then call icicle-select-frame-by-name to act on it.

As always for an Icicles multi-command:

Input-candidate completion and cycling are available. While cycling, these keys with prefix C- are active:

C-mouse-2, C-return - Act on current completion candidate only

C-down, C-wheel-down - Move to next completion candidate and act

C-up, C-wheel-up - Move to previous completion candidate and act

C-next - Move to next apropos-completion candidate and act

C-prior - Move to previous apropos-completion candidate and act

C-end - Move to next prefix-completion candidate and act

C-home - Move to previous prefix-completion candidate and act

C-! - Act on all candidates, successively (careful!)

When candidate action and cycling are combined (e.g. C-next), user option icicle-act-before-cycle-flag determines which occurs first.

With prefix C-M- instead of C-, the same keys (C-M-mouse-2, C-M-RET, C-M-down, and so on) provide help about candidates.

Use mouse-2, RET, or S-RET to finally choose a candidate, or C-g to quit.

This is an Icicles command - see command icicle-mode.


An even handier command is icicle-other-window-or-frame, bound to C-x o by default. It combines several commands for selecting windows or frames.

icicle-other-window-or-frame is an interactive compiled Lisp function in icicles-cmd1.el.

It is bound to C-x o.

(icicle-other-window-or-frame ARG)

Select a window or frame, by name or by order.

This command combines Emacs commands other-window and other-frame, together with Icicles commands icicle-select-window, icicle-select-frame, and icicle-choose-window-for-buffer-display.

Use the prefix argument to choose the behavior, as follows:

  • With no prefix arg or a non-zero numeric prefix arg: If the selected frame has multiple windows, then this is other-window. Otherwise, it is other-frame.

  • With a zero prefix arg (e.g. C-0): If the selected frame has multiple windows, then this is icicle-select-window with windows in the frame as candidates. Otherwise (single-window frame), this is icicle-select-frame.

  • With plain C-u: If the selected frame has multiple windows, then this is icicle-select-window with windows from all visible frames as candidates. Otherwise, this is icicle-select-frame.

  • With plain C-u C-u: Same as icicle-select-window with a negative prefix arg: Select a window from any frame, including iconified and invisible frames.

  • With plain C-u C-u C-u: This is icicle-choose-window-for-buffer-display, with windows from all frames (i.e., iconified and invisible) frames as candidates.

If you use library oneonone.el with a standalone minibuffer frame, and if option 1on1-remap-other-frame-command-flag is non-nil, then frame selection can include the standalone minibuffer frame.

By default, Icicle mode remaps all key sequences that are normally bound to other-window to icicle-other-window-or-frame. If you do not want this remapping, then customize option icicle-top-level-key-bindings.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.