Sent with Proton Mail secure email.
------- Original Message -------
On Saturday, August 19th, 2023 at 1:12 AM, Yuri Khan <yuri.v.khan@gmail.com>
wrote:
On Fri, 18 Aug 2023 at 17:02, Heime heimeborgia@protonmail.com wrote:
How can I have a buffer taken out from a frame and make a new frame
using elisp code ?
It does not make sense to talk about taking a buffer out from a frame.
Buffers exist within the core of Emacs independently of any frames. A
buffer can be displayed in zero or more windows, and one or more
windows are part of a frame.
I usually have a single buffer displaying a file. And want the file displayed
in a new frame. But you have outlined that I can have an additional window
showing the file.
Am bit indecisive what to do. Does one just make the file appear in a new
buffer, leaving the rest (possibility of other windows showing same file)
intact ? What would you suggest ?
1 ┌───────┐
┌───────────────┤ Emacs ├────────────────┐
│ └───────┘ 1 │
│ 1..* │ 0..*
┌───┴───┐ 1..* ┌────────┐ 1 ┌───┴────┐
│ Frame ├───────────┤ Window ├───────────┤ Buffer │
└───────┘ 1 └────────┘ 0..* └────────┘
Therefore, you create a new frame, it automatically has a window, and
you arrange for that window to display your buffer. Optionally, you
bury the buffer in the original window so that it displays something
else, or delete the original window. (See code by Christopher in the
other reply.)