11

I just started to use EMACS, it's amazing.

So I had this question, what's the difference between a window and a frame ?

my understanding is :

  1. you can press a 'q' to quit a frame not a window.
  2. frame is composed of a series of windows
  3. frame will contain a subset of all buffers.
  4. frame is more like the concept of project while window is the for each file.

3 and 4 are not correct seemingly, as when I try to jump between frames I still saw all the buffers.

so are my understanding correct? or I am not doing it in a correct way ?

is there project like function for EMACS to organize buffers into different projects, so that when I jump between buffers, I only saw the buffers localize to that project?

can some one talk more about the project concept in EMACs related with the frame and window?

2

1 Answer 1

21

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.

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.

You can find more details in the chapter of the Emacs manual on "Frames".

So your (3) is not correct; every buffer is available in every frame. (4) is not really correct either; 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.

1
  • this helped me to understand the concept of frame and window. thanks.
    – zinking
    Apr 25, 2012 at 8:47

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