Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Emacs, how can I have the same buffer open in multiple frames (when using ido/iswitch)?

In emacs, I'd like to open the same buffer in multiple frames. Before I used ido, this was easy: I'd just switch to the buffer in one frame with C-x b, then focus a different frame in my window manager, and then open the buffer in that other frame too (with C-x b again.) But, now that I use ido for fuzzy completion in C-x b, when I try to open the second copy of the buffer, it just sends the focus back to the first frame and frustrates me.

Is there a variable I can set to control this behavior?

Ideally, I'd like C-x b ENTER to not be biased at all by the other buffers that are open (normally, it tries to default to a buffer that is not open in any window.)

like image 797
Geoff Avatar asked Jul 10 '10 00:07

Geoff


People also ask

How do I switch between buffers in Emacs?

For conveniently switching between a few buffers, use the commands C-x <LEFT> and C-x <RIGHT> . C-x <RIGHT> ( previous-buffer ) selects the previous buffer (following the order of most recent selection in the current frame), while C-x <LEFT> ( next-buffer ) moves through buffers in the reverse direction.

What is a Emacs buffer?

Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer.

How do I open a new frame in Emacs?

To open a new frame, select Make New Frame from the Files menu or press C-x 5 2 (for make-frame). Emacs makes a new frame containing the current buffer and puts it on top of the current frame.

How do I close a buffer window in Emacs?

C-x 4 0 ( kill-buffer-and-window ) is a stronger command than C-x 0 ; it kills the current buffer and then deletes the selected window. C-x 1 ( delete-other-windows ) deletes all the windows, except the selected one; the selected window expands to use the whole frame.


2 Answers

It looks like

(setq ido-default-buffer-method 'selected-window)

is what you need.

like image 196
Sean Avatar answered Nov 16 '22 02:11

Sean


I use C-r in Ido to search backward through it's list. The buffer that I want has usually been pushed to the end of the list. I do tend to use multiple window splits (verticle and horizontal) instead of multiple frames.

like image 38
Bryan Ash Avatar answered Nov 16 '22 02:11

Bryan Ash