thassan
thassan

Reputation: 401

How to keep the source buffer in a separate window in emacs , while using gdb-many-windows mode

I am using emacs and gdb together. Everytime I issue gdb-many-windows I get the following buffer open up.

 |   GUD buffer (I/O of GDB)      |   Locals/Registers buffer      |

 |   Primary Source buffer        |   I/O buffer for debugged pgm  |

 |   Stack buffer                 |   Breakpoints/Threads buffer   |

This is great. But because I need to dig through the code and since I have multiple monitors. I was hoping to keep the Primary source buffer (source code debugged) to be in a separate window. And the rest of the other four buffers show up in a different window together.

For example, in window 1, I will have

 |   Primary Source buffer        |  

in window 2 , I will have

 |   GUD buffer (I/O of GDB)       |   Locals/Registers buffer      |
 |                                 |   I/O buffer for debugged pgm  |
 |                                 |  Breakpoints/Threads buffer    |
 |                                 |   Stack buffer                 | 

How Can I do that? I also would like this to be default, everytime I open up gdb-many-windows. Thanks

Upvotes: 2

Views: 603

Answers (1)

ljos
ljos

Reputation: 315

In emacs a window is the view that contains the buffer. What you want to do is create a new frame to show the other buffers in. You can create a new frame by running M-x new-frame or you can do C-x 5 b source-code-buffer-name and it will open the source code in another frame. There is also C-x 5 o to switch between the frames.

I know this is not exactly what you are asking, but it can be the starting point for some elisp scripting to get this to where you want. To get to know more about frames. To get to know more about frames in emacs you can go to https://www.gnu.org/software/emacs/manual/html_node/emacs/Frames.html#Frames .

Upvotes: 1

Related Questions