emacs - buffers, tabs, splits, windows and frames

How to kill some buffers?

Use emacs kill-some-buffers

How to select and open multiple files at once from minibuffer?

TODO

Jump between windows in a frame

C-x o - other window

Ctrl x 1 One window (i.e., kill all other windows).

Change emacs split buffers layout

Alt-X toggle-window-split

Difference between frame and window in emacs

https://stackoverflow.com/questions/10309112/diff-between-frame-and-window-in-emacs

This is a bit confusing, but it’s all due to history. Emacs was first created back in the days of text terminals, before the GUI was common. All you had was lines of monospaced text, usually around 80 columns by 24 rows. Emacs had the ability to split the screen into multiple windows, so you could see more than one file at once.

http://en.wikipedia.org/wiki/Computer_terminal

Then graphical terminals and the GUI came along, and window came to mean the GUI variety. But Emacs had dozens of functions and variables with window in their names, which dealt with its split-screen type of window. Renaming those functions would break all the Emacs Lisp code that used them. Therefore, when Emacs gained a GUI interface, its designers decided that it would be easier to come up with a new term to mean GUI window, and keep window to mean old-style Emacs window. The new term they came up with was frame (because frames are what surround windows).

So when Emacs talks about a frame, it means the same thing that other programs would call a window. In Emacs, a frame is basically a terminal emulator that can be resized on demand. Each frame acts pretty much like an Emacs running in a text terminal; the frame can contain one or more old-style Emacs windows.

However, all the frames of a single Emacs process are linked. Any buffer can be displayed in any window of any frame, and you can have the same buffer displayed in multiple windows and/or frames at the same time. Every buffer is available in every frame.

You can find more details in the chapter of the Emacs manual on Frames. https://www.gnu.org/software/emacs/manual/html_node/emacs/Frames.html

It’s up to you how many frames and/or windows you want to use. Personally, I normally use 1 frame with 1 or 2 windows. I occasionally use a second frame if I want more space to display one file while working on 1 or 2 other files.

Reading material

  1. https://www.emacswiki.org/emacs/ToggleWindowSplit
  2. https://stackoverflow.com/questions/2081577/setting-emacs-to-split-buffers-side-by-side

Links to this note