help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get buffer unto a new frame


From: PierGianLuca
Subject: Re: Get buffer unto a new frame
Date: Fri, 18 Aug 2023 15:57:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0

Hi Heime,

Just wanted to say I completely understand you. I've had to deal with similar 
conundrums for many years. My personal experience is that (in my case) there's 
simply no best rule. I've had situations in which I needed copies of a buffer 
in different frames (especially if the frames live in different virtual 
desktops), or copies within the same frame but different windows; different 
buffers in different frames, different buffers in the same frame, and whatnot...

For me the optimal solution has been to set up quicker keyboard shortcuts (avoiding all 
longer "C-x ..." ones) to ease up this kind of configuration changes.

Cool if you find a standard solution for the kind of work you do.

I'm really happy for the extreme flexibility that Emacs gives in this regard!

Cheers,
Luca



On 230818 15:41, Heime wrote:





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.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]