How to turn off *input/output* buffer in gud
Asked Answered
S

3

20

I recently switched to using GNU Emacs 24 from 23, and I notice that whenever I enter gud the *input/output* buffer is open. I have close it manually with C-x 0 everytime I debug. Can anyone point me to the correct variable which needs to be configured in order to stop displaying this buffer by default?

Sextain answered 26/11, 2012 at 8:13 Comment(0)
P
12

There is a 'gud-gdb' in new emacs releases that implement the old behavior of gdb/emacs interaction (no dedicated-windows and no I/O buffer). If you don't want to call M-x gud-gdb when you use it you can define an alias for M-x gdb

Plutus answered 21/3, 2013 at 22:49 Comment(2)
thanx .. the default gdb behavior is undesired, given that M-x gdb-many-windows has existed forever..Llama
this is not the gdb behavior before the windows were locked into place and buffer switching was prevented. This looks to be ancient gdb behavior in emacs before source code arrows etc, gosh, ~1985? Like running it inside a shell in emacs.Heterogenesis
T
7

I have this problem as well. After a quick look at the source code, the problem appears to be that GUD dedicates most of its windows (that is, it calls set-window-dedicated-p on them). A dedicated window is one that cannot be switched away from. I guess more and more young guns are using GUD in many windows mode and want GUD to manage their window layout, and those of us that like to do that manually are in the minority. There doesn't seem to be anything obvious in gdb-mi.el that disables this behavior (for example, gdb-set-window-buffer seems to always do a set-window-dedicated-p to t for all windows it manages).

For now, this solution is more or less the one I'm using -- I manually deactivate the window dedication. This seems suboptimal, though. There ought to be some way to get GUD to let you manually manage the window layout. This question is related.

Triatomic answered 29/1, 2013 at 8:6 Comment(2)
For some reason, your fix only works for a little bit - then the window pops up again in dedicated mode, each time it gets a new output.Sirrah
by 'young guns' you mean people who are not emacs users who are forcing gdb to look like their favorite other tool that is not nearly as powerful. In the minority, I doubt it, everyone I know has this behavior switched off. Though now I'm running into fixes for this breaking other things. A central design feature of emacs is that it puts the user in control of the interface. This takes us back to an interfaced forced upon us, it forces me to look at a buffer that has no meaningful information, while preventing me from switching to a buffer that I want to see.Heterogenesis
M
6

You can disable window dedication altogether like this: (in Emacs 24.4+)

(defun set-window-undedicated-p (window flag)
 "Never set window dedicated."
 flag)

(advice-add 'set-window-dedicated-p :override #'set-window-undedicated-p)

Note that this doesn't affect already dedicated windows.

Multiparous answered 16/4, 2015 at 23:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.