I am trying to check how frame, buffer, and file work.
It seems to me that frame commands(C-x 5 ...) create a frame,
whether a buffer or file exists or not.
Here is what I am thinking:

C-x 5 2
1. Create a new frame.
2. Copy the current buffer into the new frame.

C-x 5 b bufname <RET>
1. Create a new frame.
2-1. Check if the bufname buffer exists.
2-2. Create a new buffer if 'bufname' does not exist.
3. Copy the buffer into the new frame.

C-x 5 f filename <RET>
1. Creates a new frame.
2-1. Open the file specified.
2-2. Create a new file if not exists.
3. Create a new buffer using the file above.
4. Assign the opened filename to the buffer name.
5. Copy the buffer into the new frame.

  1. Am I right? It seems to me that we can have multiple frames for a single buffer.

  2. Is emacs buffer a mapping between a buffer name and character sequence in memory?

  3. When you open a file, does emacs assign a buffer name with its name(without extension) and add to the buffer list?

  • Yes, pretty much. But wait for real answers here. A buffer is implemented using more than a single character sequence in memory, but yes, that's the idea. A buffer visiting a file typically has the file name, including extension as the buffer name, but it need not.
    – Drew
    Commented Apr 15, 2020 at 1:37
  • You should really only pose one question per question. But this buffer-file-frame relation set of a few questions seems OK, to me.
    – Drew
    Commented Apr 15, 2020 at 1:38
  • Instead of "Copy the buffer into the new frame" instead think: "Display the buffer in a window in the new frame". (The new frame will generally only have one window, but it's still the window which directly displays the buffer.) In particular, no matter how many windows it appears in, the buffer itself is not being copied.
    – phils
    Commented Apr 17, 2020 at 3:07

1 Answer 1


Yes, I think you have it right. From my understanding, buffers and frames are completely decoupled. Buffers can have an associated file, but that is not required.

Maybe these will help:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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